Announcement

Collapse
No announcement yet.

HIDING JAVA Script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    HIDING JAVA Script

    How do I move the Java script into its own file and linking it to the head of the document?
    I want to hide the java script in my main page.
    I have been told to do this I need to make a link like:
    <script language="JavaScript" src="menus.js">

    I am not sure how to do that. can you please walk me through it step by step. thanks.

    #2
    That's all you need to do except you need a </script> tag after your line. E.g.

    <script language="JavaScript" src="menus.js"></script>

    Does the job.

    If you want this in code loaded in all Actinic pages the put the above line into Act_Primary.html (near other similar lines). Make sure the file menus.js is in your Site1 folder and Actinic will upload it for you.

    If you're using this on a non-Actinic page then you'll have to upload the js file manually into the same directory as the page that calls it (just like you do for images). You can also specify a full path name if you need. E.g. the src="..." bit above becomes

    src="http://myserver.com/mydir/menus.js"

    Also when you move JavaScript into a file and load it as above you no longer need the <script...> and </script> tags in that file (they're there in the tag that loads that file) so edit them out.

    Finally this doesn't really "hide" the javascript from a determined user. They can still examine your source, find out the name of the javascript file and then tell their browser to load that file (which they can save to disk to pore over).

    Norman
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment

    Working...
    X