Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: External .js

  1. #1
    New to the CF scene
    Join Date
    Jul 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    External .js

    I use a lot of .js and need to place some of it in an external file. The problem is that the only articles I have seen so far (i.e. the date stamp) shows how to hide the js which is in the <head> of the page. The problem I've got is that I also need to hide the js that is within the <body> of the page as this is by far the largest part of the script. Please take a look at http://www.all-inclusive-hotels.co.uk/index.html and if you go to View - Source you will see the large script associated with the menu's on the page. Does anyone know a way I can place this <body> part of the script in an external .js file? This is my first posting to this group so please forgive me if I've done anything wrong. Fred

  • #2
    Regular Coder
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    375
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hiding is no longer an issue. Stop hiding. Just use:
    Code:
    <script src="some.js" type="text/javascript"></script>
    wherever the original script appeared in the page and put the original script in the file some.js after removing its opening and closing tags as well as any of that hiding nonsense.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •