Results 1 to 3 of 3

Thread: Switch Content - Can It Be An External JS???

  1. #1
    Join Date
    May 2005
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Switch Content - Can It Be An External JS???

    Hi guys,

    I'm currently using the Switch Content script whereby you can collapse and expand text on the page.

    http://www.dynamicdrive.com/dynamici...tchcontent.htm

    I think it's brill, however the javascript you need to put in the HEAD of the document is quite long. I've tried to place it in an external JS file and then link it, but for some reason this stopped the script on the page from working.

    Is it possible to do this? Can anyone help me please? As it makes the code really long oterhwise when trying to alter anything on the page.

    Thanks!
    Matt Blank

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    It should be possible to do. Make sure you've included the external file properly, and make sure there is only Javascript in the external file -- HTML tags (such as <script></script>) and HTML comment delimiters (<!-- -->) are not allowed.
    If this doesn't help, please give us the URI to your page.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    May 2005
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ahhh thanks! I had the <script> tags left in...didn't realise they should come out! Works great now.

    Many thanks for your help!
    Matt

Bookmarks

Posting Permissions

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