I have a question - I have created a nifty java script, and I would I bury the java script for the <head> section of a site within .css.
Is it possible to put java script within .css and to be placed in a specified area like the <head>? If so would anyone be willing to share an example?
Could not find much info anywhere so that is why I have come here ;)
Thanks much!
eboda
There is a way which should work for you though,
simply put the javascript inside a file, for example myscript.js (the extension dosent really matter, but it's easier to find that way), and then use this code to include that script in your page:
<script language="javascript" src="myscript.js"></script>
Do not use <script> tags inside the myscript.js file, it should look like this:
(start myscript.js)
(end myscript.js)
alert('I dont really do anything, i\'m an example!');
You can place the <script lang...> tag anywhere on the page, if you put it in the <head> then it will be loaded before any content is displayed to the user.
HTH,
Dw
(Ducking away thumping myself on the head ... ugh!) :)
Thanks
eboda