This Message Forum is no longer in use

Please use the new Bravenet Help Forums FOUND HERE

General Forum
This Forum is Locked
Author
Comment
How to insert java script between Head /Head tag?

Hi,

Having trouble understanding how to insert java
script into my website.
I have pages of links see:
http://driverfan001.bravehost.com/picture.html

If you'll notice each link has a enter key on
the left of it which I want to use as the hyper-
link to that particular site on the web.

What i'd like to do is use () to have a sound
activated and change the enter icon to something
else briefly when it's pressed.

The problem I'm having is I have to enter the script
between the head /head tags . How do I do this?
(tried to use the text editor,Loaded up picture.html
added the script between Head /Head tags and saved
but didn't seem to be there when i looked again)
Would also like to shorten as much as possible the
lines of code inserted into the body of the html
by use of scripts function() possibly as there
are a lot of lines... but again script functions
belong between the head /head tag.

Your Help Greatly Appreciated!
driverfan

Re: How to insert java script between Head /Head tag?

{What i'd like to do is use () to have a sound
activated and change the enter icon to something
else briefly when it's pressed}

should read......

{What i'd like to do is use {()} to have a
sound activated and change the enter icon
to something else briefly when it's pressed}

What happened there ?
driverfan

Re: (1 more time) I want to use onclick

should read I want to use ON_CLICK...

have to use _ so it will show up.......

driverfan

Re: How to insert java script between Head /Head tag?

You canot use wizard and file manager to edit
the same pages.If you edit using file manager
text editor and save
and then go back to wizard to edit and publish
you lose your scripts cause the wizard publish will erase file manager editors updates/edits/changes.

If You use just file manager editors only
no more wizard then the scripts should stay
if you save your work.

Re: How to insert java script between Head /Head tag?

Don't bother trying to post HTML or Javascript references, if you don't know how. The forum is sensitive to HTML and completely disallows some Javascript event references, like OnClick();, OnMouseOver();, etc., unless you know how to make them display.

If you have access to your web site's structure, it is best to put all your Javascript functions there and keep them out of the way. But it's not required. As long as it's wrapped and structured correctly, you can put Javascript anywhere in your code.

The Wizard limits your access to the structure. If your using some other editor to add it to your structure, stop. Wizard designs should not be edited with any editors, outside of the Wizard's content editors. The Wizards content editors have a "Code Editor" mode for inserting HTML/Javascript. But even then, it's not that simple. If your attempting to just copy/paste some Javascript from a web site, and don't understand how it works, chances of you getting it to work are slim. The Wizard's editors do some odd things to seemingly good code, rendering it useless.

For what you want to do, the best approach is to start simple. First get the OnClick(); or OnMouseOver(); operation working and then deal with the sound. Personally, I say, don't waste your time with the sound. No one really wants web pages that make noise.

The idea behind flipping images is to give your tag a name and the reference the name in the link that's wrapped around it. Below is an example of using a OnMouseOver(); event to flip an image. It assumes that you have two images, "image1.gif" and "image2.gif". The first image, "image1.gif", is included in the tag and then both images are made part of the link. The OnMouseOver(); event flips the image to the second image, "image2.gif". The OnMouseOut(); event will switch it back to the first image.



Keeping is simple like this will allow it to work in the Wizard. If you want to use more complicated Javascript, like for preloading images, or other effects, put the Javascript in a separate file and source it from your Wizard creation. This will keep the Wizard from messing with code and rendering it useless.