From your comment to James:
It seems like there's something missing from it. I thought a "}" but not matter where I add one of them it doesn't work :-(
The missing } should be at the end:
function lazy_load_html() {
jQuery(document).ready(function($){
if (navigator.platform == "iPad") return;
jQuery("#content,#footer").find("img").lazyload({
effect:"fadeIn",
placeholder: "http://www.domain.com/long-path/grey.gif"
});
});
}
// ^-- here
Other things to check:
1) You'll want to be sure that the script tag for this external file is after the jquery.js one.
2) Make sure something somewhere is actually calling the lazy_load_html function, or get rid of it. If getting rid of it, just remove the first and last line of the above, like so:
jQuery(document).ready(function($){
if (navigator.platform == "iPad") return;
jQuery("#content,#footer").find("img").lazyload({
effect:"fadeIn",
placeholder: "http://www.domain.com/long-path/grey.gif"
});
});
There's no particular reason you need to have it in its own function, the jQuery(document).ready part already handles deferring actually doing the hooking up of the images for you.
}.