Andrea Girardi - It's my blog!

Tag: JavaScript

Make jquery function run on page load

Load jQuery when the HTML document is loaded:

$(document).ready(function() {
	// business code
});

Load jQuery when all the images on a page have also loaded:

$(window).load(function() {
    // business code
});

Change Eclipse settings to ignore jquery errors on a specific file

In my dynamic web project in eclipse, I have jQuery in my js source folder. For some reason, Eclipse is not handling it correctly and interpreting many lines as errors in the standard jQuery file (even though I have the javascript development tools installed).

I have found that I can leave the JavaScript Validator enable and ignore specific files by adding a suitable exclusion pattern e.g. **/jquery*.js to the JavaScript/Include Path/Source/Excluded group (Project->Properties->JavaScript->Include Path->Source).

Copyright © 2017 Andrea Girardi – It's my blog!

Theme by Anders NorenUp ↑