Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

dwt- Where to Put Script

0 views
Skip to first unread message

Miro

unread,
Sep 6, 2009, 11:31:42 PM9/6/09
to
I am having a bit of trouble trying to figure out where to put my javascript
I have for my image rotator.

I use to put it into the body "onload", but because I made this page with a
"dwt"(dynamic web template), then I can only access the Div "Content" tag
within my page that uses the script.

Thats fine, I added the script within the div tag, but I cant figure out
where to put some "onload" code.

I dont want to put it into the dwt as the script will only be run in one of
the pages.

Any suggestions or help would be appreciated.

Thanks

Miro

senn

unread,
Sep 7, 2009, 2:25:09 AM9/7/09
to

"Miro" <mi...@beero.com> skrev i meddelelsen
news:%238se6u2...@TK2MSFTNGP02.phx.gbl...
Have a folder to it. And put the file having an extention of .js into the
folder.
As done here. Always try to look up your design problems on this site:
http://www.w3schools.com/js/tryit.asp?filename=tryjs_externalexample
/senn

Miro

unread,
Sep 7, 2009, 7:52:26 AM9/7/09
to
Thank you- I will try that.

I got it working last night with a solution that is not as ellegant,
here it is:
< I basically call the script "window.onload" after 3 seconds after the load
>
The whole page should be loaded by then.

<script type="text/javascript">
<!-- Hide from older browsers
var RotatePhoto = new Array()
var RotateAlt = new Array()
var nPhotoCounter = 0
var cMiscVar

RotatePhoto[0] = "Images/OrangePics/OrangeCar.png"
RotatePhoto[1] = "Images/OrangePics/OrangeCatterpillar.png"
RotatePhoto[2] = "Images/OrangePics/OrangeCup.png"

function RotateThruPics()
{
document.RotatePics.src = RotatePhoto[nPhotoCounter]
//document.getElementsByTagName('RotatePics')[0].src =
RotatePhoto[nPhotoCounter]
nPhotoCounter = nPhotoCounter + 1
if( nPhotoCounter > 2 )
{
nPhotoCounter = 0
}

cMiscVar = setTimeout("RotateThruPics()",3000)
}

window.onload = function(){ setTimeout("RotateThruPics()",3000) }

// end hiding -->

"senn" <senn@homeplace&.fix> wrote in message
news:ed0IzP4L...@TK2MSFTNGP04.phx.gbl...

Tina Clarke

unread,
Nov 6, 2009, 11:14:25 PM11/6/09
to
"Miro" <mi...@beero.com> wrote in message
news:uu9muG7L...@TK2MSFTNGP04.phx.gbl...

> Thank you- I will try that.
>
> I got it working last night with a solution that is not as ellegant,
> here it is:

http://www.areasonforchocolate.com/

You can see the body onload working with a dwt on the above link

hth Tina
--
Free Expression Web Toolbar - Expression Web and Web Design Resources
http://frontpage-to-expression.com/expression-web-community-toolbar.html
Just posted new links to the toolbar - Make YOUR suggestions
Will work in FireFox IE and Safari

0 new messages