javascript not in < head > </ head> ?
i need to place some javascript (simple img-mouseover) into the body of a page.
i thought, it would be possible to just use <script></script> in the body part and place the code between. since i'm not good in javascript, i didn't get it to work.
could someone post some code-samples? i took mine out of hotscripts.com but everywhere <script> is placed in the head...
tia!
taff posted this at 10:58 — 19th July 2001.
They have: 956 posts
Joined: Jun 2001
The script itself should be in the header and called from the body. The reasoning here, in simplistic terms, is to ensure that the script is loaded before it is called.
There ARE cases where a script can reside in the body but mouseovers aren't one of them.
I do recall seeing the following structure depicted somewhere:
*
*
<script>
*
*
</script>
*
*
I have no idea if this works.
For samples try javascripts.com
For a tutorial try http://webteacher.com/javascript/
.....
merlin posted this at 11:30 — 19th July 2001.
They have: 410 posts
Joined: Oct 1999
thank you taff.
convinces me.
well, since this mouseover is not THAT important, i just start the animation after n seconds and don't make the mouseover.
except anyone else knows a way?
thanks anyway!
NSS posted this at 15:42 — 19th July 2001.
They have: 488 posts
Joined: Feb 2000
Hi,
The below url has a working example including the code for "mouseover effect" using Javascript.
http://bignosebird.com/js/mouse.shtml
Hope this helps.
Anonymous posted this at 17:16 — 19th July 2001.
They have: 5,633 posts
Joined: Jan 1970
I never use BODY HEAD or HTML tags...Here is one with a roll-over image:
merlin posted this at 05:47 — 20th July 2001.
They have: 410 posts
Joined: Oct 1999
thanks bubbleman, it works. but only in ie, not in nn (nn is standard in our company ).
anyway, it's exactly what i was looking for!
Mark Hensler posted this at 06:43 — 20th July 2001.
He has: 4,048 posts
Joined: Aug 2000
does self.src work?
merlin posted this at 07:22 — 20th July 2001.
They have: 410 posts
Joined: Oct 1999
hm?
well, i realize, i really have to take some time to learn some javascript...
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.