View Full Version : Two Scripts One Page Help!!!


DancN_DragN171
03-30-2003, 05:34 PM
:s
okok. I have two javascrpits on this page
http://www.geocities.com/dancn_dragn171/loading.html

one is an animated text floating/fading thing
and the other is typing script (it types "loading" several times so that it fools my freinds into thinking i have a really "hightech flashy flash page" lol)

my problem is that only one script will work at a time. why oh why???? can any one PLEASE help????

any help would be GREATLY appreaciated!

thank you!!!!!!!!!!

the_dark_one02
03-30-2003, 05:51 PM
well for one thing u dont have 2 scripts (theres lots) but if im not mistaken most scripts are suposed to be placed in the <head></head> tags. see if that works!

Dude128
03-30-2003, 06:22 PM
the whole page's code needs some cleaning up- you have a <center> tag in the head section, and the scripts aren't in either the head or the body sections.

modify your code so that it's in this general format:

<html>
<head>
CSS
Script 1
Script 2
</head>
<body>
ALL your content goes here
</body>
</html>

DancN_DragN171
03-30-2003, 07:02 PM
Hey OMG Thanks Alot It! I cleaned it up a bit...

(Its IS messy isnt it *embaressed*)
But theres a text box that popped up!
Wherd that come from!??!?!?!?!
:S

*confused* :s :s :s help?? please?

Thank you! :D

Ohh P.S. The instructions for the floating/scrolling/fading script said for in to be put in an open space. well its in the <head> and seems to work fine lol....im soo puzzled

(actaully im always confused about everything: just ask my friends lol)

DancN_DragN171
03-30-2003, 07:56 PM
OMG IM SORRY GUYZ!! THANKS SOOOOOO MUCH FOR YOUR HELP THOUGH!!!! IM SOO STUPID *SMACKS FOREHEAD!!* GAHHHAHA:'(

I FOR GOT THE READ THIS: ( Im such a dumb bum¤)!!!

Technical Note

This script accesses the BODY onload event (window.onload). If you have another script on your page that does the same, one of them will not run. Click here for information on getting both scripts to work simultaneously.

well i know what the problem with the two scripts is. They both have two different peces of information whih are clashing. (gahh!)
The piecies are the body onload tags. The typing script body onload tag clashes with the fading script. kapeesh? :s

well i think the way to fix it is to combine both script onload tags like this:

EXAMPLE #1:
SCRIPT 1: <body onload="dothis()">
SCRIPT 2: <body onload="dothat()">
RESOLUTION: <body onload="dothis();dothat()">

EXAMPLE #2:
SCRIPT 1: <body onload="dothis()">
SCRIPT 2: window.onload=dothat()
RESOLUTION: <body onload="dothis();dothat()">

EXAMPLE #3:
SCRIPT 1: window.onload=dothis
SCRIPT 2: window.onload=dothat
RESOLUTION: <body onload="dothis();dothat()">

(or atleast these were the solutions that wee given to me :s)
I think My solution is #3. (even if theyre all the same lol)

My NEW problem is im not sure which tags are the window.onload.action tags. I keep using the wrong ones or taking the wrong part of the tag and totally corupting the javascript!!!


Can anyone help me and let me know which tags i should use?!!?
ANY HELP IS ALWAYS GREATLY< GRATLY APPREACIATED!!

!!!!! THANKS SOO MUCH !!!!!!!