Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

onload....asp or js?? 1

Status
Not open for further replies.

mtpgringa

Programmer
May 14, 2002
18
0
0
US
my site is all asp. for some reason my designer put a javascript preload code in the main page (but only the main page) in addition to a preload statement in the body tag of hte page. We're getting errors, but if I take out the JS code, I get none on the first page....but on all subsequent pages. My designer said that I shouldn't take out the JS code....

I'm thinking I should not only take out the JS code on the main page, but also preload images on all other pages that have rollovers--in the body tag as well?

Do i need the js code in addition to the bodyonload tag?

<script language="JavaScript" type="text/JavaScript">
<!--
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.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}}
}
//-->
</script>
<body bgcolor="E6E5D0" topmargin="0" onLoad="MM_preloadImages('images/hm_butt_er_on.jpg','images/hm_butt_women_on.jpg','/images/hm_butt_healthy_on.jpg','/images/hm_butt_cancer_on.jpg','/images/hm_butt_motion_on.jpg')">
 
Do i need the js code in addition to the bodyonload tag?

YES.

if you want you can put all this script(js code) in another .js file and then include this file in your asp page...

-DNG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top