Web Hosting Talk







View Full Version : Annoying HTML Error I can't solve!


AmishPatel
04-25-2009, 01:43 PM
Just got a new design and theres an error code from one of the pages...

the code in question is:


<body background="/design/bg.jpg" bottommargin="0" topmargin="0" leftmargin="15" onLoad="MM_preloadImages('/images/06header_mo_03.gif','/images/06header_mo_04.gif','/images/06header_mo_05.gif','/images/06header_mo_06.gif','/images/06header_mo_07.gif','/images/06header_mo_08.gif','/images/06header_mo_09.gif')">


The error is 'Object Expected'

Any ideas guys? I'm a bit of newb in terms of programming and things.

Firefox says the error is because MM_preloadImages is not defined... so my question is where do i define that and how?

Thanks!

Mycwd
04-25-2009, 02:44 PM
you need to write a javascript file, onLoad = loads the js file.

bear
04-25-2009, 02:47 PM
Firefox says the error is because MM_preloadImages is not defined... so my question is where do i define that and how?

When you created the page, Dreamweaver should have inserted the javascript for that function in the head of your document (between <head> and </head>). If it isn't there, or you copied this from somewhere and aren't using DW, you will need to create or find the function.
Are you using Dreamweaver?

AmishPatel
04-25-2009, 02:53 PM
Hey didnt use dreamweaver as far as I know.. so not much idea.. any simple guide i can follow to fix this? Alternatively is there anyway I can completely change the code at all? I think it just needs to load those files..

Thanks guys.

bear
04-25-2009, 02:55 PM
"onLoad="MM_preloadImages"
That is proprietary Dreamweaver JS code. If you're not using Dreamweaver, what created that code? Is this page copied from somewhere?

Show/link to the page?

Steve_Arm
04-25-2009, 02:57 PM
Yes preload them with HTML. Add below tags before body closing tag
and delete the onload handler.

<img src="/images/06header_mo_03.gif" alt="" style="display: none;" />
<img src="/images/06header_mo_04.gif" alt="" style="display: none;" />
<img src="/images/06header_mo_05.gif" alt="" style="display: none;" />
<img src="/images/06header_mo_06.gif" alt="" style="display: none;" />
<img src="/images/06header_mo_07.gif" alt="" style="display: none;" />
<img src="/images/06header_mo_08.gif" alt="" style="display: none;" />
<img src="/images/06header_mo_09.gif" alt="" style="display: none;" />

AmishPatel
04-25-2009, 05:01 PM
Ok I added tags didnt work Steve...

how would they be insert with the following below?

<body background="/design/bg.jpg" bottommargin="0" topmargin="0" leftmargin="15" onLoad="MM_preloadImages('/images/06header_mo_03.gif','/images/06header_mo_04.gif','/images/06header_mo_05.gif','/images/06header_mo_06.gif','/images/06header_mo_07.gif','/images/06header_mo_08.gif','/images/06header_mo_09.gif')">

AmishPatel
04-25-2009, 05:27 PM
ah I give up. Website is http://www.wrestling-edge.com

If you guys want to view the source code? I tried defining it and now it says it expects a ')' on line 50 but I can't see where.

bear
04-25-2009, 05:47 PM
If you're not using Dreamweaver, where did this code come from? Why would you be using DW code at all? You've taken the DW onLoad line and moved it into the head, but that isn't the DW code that needs to be there. You need the code that defines what it does there. This is old, but shows what I'm referring to:
http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_13966

To add to this, you also need the script that defines the swap image behavior called here: onMouseOver="MM_swapImage
Again, that's defined in the head somewhere.

Line 50 looks like part of the ad code, not this DW code issue.

(by the way, please add [ code ] tags around long lines so it doesn't screw up the page. ;))

Outlaw Web Master
04-25-2009, 08:23 PM
http://validator.w3.org/check?uri=http%3A%2F%2Fwww.wrestling-edge.com%2F&charset=%28detect+automatically%29&doctype=Inline&group=0&st=1&user-agent=W3C_Validator%2F1.654

hmmm

owm