Forum Moderators: open

Message Too Old, No Replies

<Body onload=....

I need to put in 2 commands - how?

         

BlueGhost

2:57 pm on Jan 15, 2004 (gmt 0)

10+ Year Member



I am new at using Dreamweaver and I have set up a page thae is built from a template. In the Body tag I now have a <body bgcolor="#ffffff" onLoad="MM_preloadImages('../images/home_f2.gif','../images/about_f2.gif'... to load some rollover buttons. The problem is that on one of the pages I would like to load another onload="runSlideShow()". Dreamweaver does not let you edit the body fields of a page that wes created from a template - will it does in a code editor but I am afraid to use it (cause I don't know what I am doing.)

1. I'm not sure how to add 2nd command like unload to the body tag.
2. If I do on the template then it will be used on every page I creat for the site and if it is some how screws up then I am lible corrupt the whole site.

Can anyone help me out with this?

divaone

3:11 pm on Jan 15, 2004 (gmt 0)

10+ Year Member



for the body tag try:
...onload="function1();function2();"

to keep everything seperate try calling these functions from an external script. example - javascript.js. contents of javascript.js:

onload = funtcion1;function2;

then call your javascript within the header:
<script language="Javascript" type="Javascript" src="javascript.js"></script>

hth

robert adams

5:32 pm on Jan 15, 2004 (gmt 0)

10+ Year Member



Don't be afraid to edit the code by hand. Always make a copy of the file you are working on, that way if you get it all screwed up, you can just throw it away and you still have the original.

If you start learning how to edit the code you will find out it is not that hard and besides you will learn a lot about how it all works.

luck,
robert

BlueGhost

2:42 pm on Jan 16, 2004 (gmt 0)

10+ Year Member



Thanks for the help.

BTW I am not afraid to edit the code on a single page "caus it is only one page. It is messing around with main tags like body in a template that will used through out the site id another matter. Then come to find out later that you screwed up. With my memory (I am afflicted with CRS) in a week I won't remember what I changed let alone a month from now and in 6 months - what site are you talking about?

Again thanks for the help I will give it a try.

John

too much information

2:50 pm on Jan 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



One more suggestion is that you could create a new javascript that calls all of the functions that you need, then call that script from the Onload= command.

OnLoad='LoadStuff()'

<script language='JavaScript' type='text/JavaScript'>
function LoadStuff()
{
Stuff1();
Stuff2();
Stuff3();
}
</SCRIPT>