Forum Moderators: open

Message Too Old, No Replies

HTML Problem

Dreamweaver giving me an error on HTML it created

         

aaronjf

10:06 pm on Apr 6, 2002 (gmt 0)

10+ Year Member



Can anyone tell me why Dreamweaver is tell me this is an invalled markup. It is saying there is a problem with the <body onLoad=

<body onLoad="MM_preloadImages('../images/graphical_links/top_nav/images/home_01-over.gif','../images/graphical_links/top_nav/images/directions_01-over.gif','../images/graphical_links/top_nav/images/store_hours_01-over.gif','../images/graphical_links/top_nav/images/order_01-over.gif','../images/graphical_links/top_nav/images/contact_01-over.gif')">

tedster

10:27 pm on Apr 6, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Looks like straightforward code to me. What is the exact error your getting?

<added> I'm assuming you added those line breaks in the image URLs. If not, that's the place to look. </added>

aaronjf

11:45 pm on Apr 6, 2002 (gmt 0)

10+ Year Member



<?> invalid makeup

<body onLoad=

Purple Martin

2:18 am on Apr 8, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



aaron - the code looks good. You haven't by any chance accidentally deleted/changed the MM_preloadImages function it's calling?

tedster - those aren't line breaks, it's just your browser word wrapping (it assumes that a new word starts after a hyphen). ;)

tedster

3:55 am on Apr 8, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm curious about the word "makeup", as opposed to "markup". Is that and internal message from DW?

Purple - right you are, it's a browser function (my breaks were coming after slashes, not hyphehs)

I often need to edit the code pasted in on the forum to get it to break somewhere so we avoid horizontal scrolling, and I made a wrong assumption.

aaronjf

4:43 am on Apr 9, 2002 (gmt 0)

10+ Year Member



LOL, Makeup. Sorry guys. The primary site the company I work for has a large stage makeup section that I have been working on a lot lattely. Must have makeup on the fingers...

aaronjf

4:43 am on Apr 9, 2002 (gmt 0)

10+ Year Member



Purple - No I have not changed the code what so ever from what you are seeing in the discussion.

pageoneresults

4:52 am on Apr 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Can I maybe ask a not so smart question? Why is all this code in the <body> tag?

<body onLoad="MM_preloadImages('../images/graphical etc...

Shouldn't it look more like this...

<body onLoad="MM_preloadImages();">

and then this code wherever it belongs...

('../images/graphical etc...

tedster

8:07 am on Apr 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Dreamweaver gives you a standard "one size fits all" function to preload images, and then you pass it the variables (image file names) whenever you call it.

You're right, pageoneresults, it would look neater your way.

(edited by: tedster at 2:43 am (utc) on April 12, 2002)

pageoneresults

8:22 am on Apr 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Are you confirming that all of that code is in the opening <body> tag? Really? I can't say that I've ever seen that. I typically work with a very short onload event as shown above and then everything else is in an external .js file. Am I missing something here or is this the DW way?

aaronjf

1:40 am on Apr 12, 2002 (gmt 0)

10+ Year Member



Just the DW way I suppose.

tedster

2:50 am on Apr 12, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It looks worse than it is. The code is just passing 5 parameters - URLs for the images - back to the preload function. But the pathnames are very long in this case.

I suppose the idea of preloading images after the document has loaded is that the images aren't visible in the initial rendering of the page, so why use up bandwidth while the main page load is occurring.

However, I often preload rollover images right in the head, or as the last bit of code before the </body> tag - to no detriment that I can see. But DW prefers to do the preloads "onLoad", which really is a hair better, especially for very "fat" pages

pageoneresults

4:03 am on Apr 12, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I guess I've just been real aggressive at trimming out as much code bloat as possible. Typically my <body> tags look like this...

<body onload="preloadImages();">

Anything else that would be in the <body> and even the <head> tag goes into external .css or .js.

I'm just trying to provide the quickest route from point a to point b! ;)

tedster

3:40 am on Apr 13, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, you could put those image filenames right in the function definition and then streamline the <body> tag. And as long as you are preloading the exact same image files on every page, you can call the preload function from an external js file.

I also prefer the streamlined HTML.