troubleshooting Question

Do I need to remove <body onLoad="MM_preloadImages... from page?

Avatar of mamadouthiam
mamadouthiam asked on
Web Languages and StandardsJavaScript
7 Comments1 Solution1349 ViewsLast Modified:
We have recently updated some pages on our site and I noticed that there are a bunch of remnant images in the<body onLoad> tag that are not used on those pages (e.g. the rollover version of a button appears to preloaded but the actual button has been removed from the page).

My initial concern was that page load times would suffer unnecessary and that I should go into all of these pages (manually) and remove the rollover images that are not useful. However, when I ran a speed test on The images did not appear to be loading at all (and perhaps this whole thing is a none issue. The JavaScript for this is below.

So issue or non issue?


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 7 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros