Another way to do <body onload="initmapbuilder()">

Associate
Joined
25 Apr 2007
Posts
139
Evening,

My site is designed using Macromedia Dreamweaver and I have set the website up using templates. My body tag is part of the locked content with only the background image being editable.

I have a page which requires me to use <body onload="initmapbuilder()"> to run a javascript. But seeing as my body tag is not editable is there another way of achieveing this without putting it in the body tag?

Hope this makes sense.

Cheers
Simon
 
I don't know how you'd do it with Dreamweaver as such, but you can do the same thing with unobtrusive JavaScript. You should just be able to stick something like this into your editable area to have it execute:

Code:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
   $(document).ready(function() {
     initmapbuilder();
   });
</script>

(if you already have jQuery loaded then remove that line from above, or better yet stick it in your template).


edit: beat :o.
 
Back
Top Bottom