SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Hybrid View

  1. #1
    SitePoint Zealot jplatenius's Avatar
    Join Date
    Nov 2003
    Location
    Vancouver Island, Canada
    Posts
    112
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how to export javascript to external files?

    I'm trying to keep my code clean, and would like to attach my javascript in a separate file. Problem is, my javascript is generated by Dreamweaver MX, and it doesn't appear to be as simple as pasting the script from the head and attacing the file like this document from Dreamweaver support says: http://www.macromedia.com/devnet/mx/...ive_steps.html

    I understand the concept here, but I have a sneaking suspision that the mm_menu.js file that dreamweaver creates for my drop down menus is messing me up.

    The site is here: www.virtuallycertain.com/test/layout.htm

    Are there any wise gurus who can lead me in the right direction here?

    Thanks,
    -jp

  2. #2
    SitePoint Zealot cmorbutts's Avatar
    Join Date
    Apr 2002
    Location
    Sydney, Australia
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    jp,

    THe steps in the tutorial you put hte link to should be all good. Are you putting the correct path to the js file in your source?

    Nice site by the way.

  3. #3
    SitePoint Zealot jplatenius's Avatar
    Join Date
    Nov 2003
    Location
    Vancouver Island, Canada
    Posts
    112
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Jason and anyone else who may be able to help,

    Thanks for the response Jason -- I've been very ill last two days and offline.

    Anyhow... my path is good, and I've tried and tried. In fact, I just tried again taking your words as encouragement. Have you attached external files with this sort of Dreamweaver situation before? I put the the two files up here: www.virtuallycertain.com/test/Linked.htm (the page with the contains linked js file that doesn't work)
    www.virtuallycertain.com/test/KayakScript.js (the linked file)

    I'm stumped.

    Any more help would be so very welcome...

    Cheers,
    -jp

  4. #4
    SitePoint Zealot cmorbutts's Avatar
    Join Date
    Apr 2002
    Location
    Sydney, Australia
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    jp,

    Just had a look at your js file. Try removing the <script> tags... just have your functions in there not enclosed with any <script> tags.

  5. #5
    SitePoint Zealot jplatenius's Avatar
    Join Date
    Nov 2003
    Location
    Vancouver Island, Canada
    Posts
    112
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Jason,

    Still no go. I took out <script language="JavaScript" type="text/JavaScript"> and </script>, and still nothing.

    I'm suspicious of the linked file that DWeaver puts into the body tag: (<script language="JavaScript1.2">mmLoadMenus();</script>) for the drop down menus. I can't see how this could mess anything up, but that's my only thought as to why it's not working. I've googled and searched Marcromedia's support, but no avail....

    Any other thoughts? Man this is frustrating. You go the extra mile to clean up your code and this is what you get? Serves me right for not fully hand coding my JS, I guess.

    Thanks for helping me here. I'm pretty new to the game. Any more suggestions are more than welcome...

    Cheers
    -jp

  6. #6
    SitePoint Zealot cmorbutts's Avatar
    Join Date
    Apr 2002
    Location
    Sydney, Australia
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    jp,

    Your path to the KayakScript.js file is wrong. Change it to

    <script language="JavaScript" type="text/JavaScript" src="KayakScript.js"></script>

    The mm_menu.js file should be fine.

    Give that a go and see... if it still doesn't work let me know and I'll look into it further!

  7. #7
    SitePoint Zealot jplatenius's Avatar
    Join Date
    Nov 2003
    Location
    Vancouver Island, Canada
    Posts
    112
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Jason Wong--you are the man! Thanks so much for your help. Damn the file path!

    Works perfectly, and now I can finally get on with my life or lack there of.

    Cheers Dude,
    -jp

  8. #8
    SitePoint Zealot cmorbutts's Avatar
    Join Date
    Apr 2002
    Location
    Sydney, Australia
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No worries man. I'm glad it's all good now.


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
  •