I need to place some javascript code in an external file. I just need a basic rollover is there an action for this, as I do not need all the features of the rollover action.
The code above is generated by freeway (version 4 pro) and I need to place this in an external js file, how should I do this?
I just need to know what the correct syntax is, as I know you lose the script type etc… in the external js file.
The first two blocks of script you have above contains conditional comments. These would not work inside an external script, you would need to keep them in the HTML. The third one would be ripe for moving out of the page.
In your external file, start with the word function and end with the last closing brace } – in other words, remove the comments and the script tags. Save this file in a proper text editor with a filename that ends in .js.
In your page, open the HTML Markup dialog and paste the first two blocks of script (and their script tags and comments) into the After HEAD section. Then apply the External JavaScript Action to the page, and select your JavaScript file and choose Before /HEAD for the location.
This should get your scripts in the right order, and the Action will manage the upload and linking of the external JavaScript file.
As you can see the second one works in windows explorer but has no rollover so it must be something in the js file rolls.js that is causing the problem.