Putting Javascript into External File

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • taya74
    New Member
    • May 2010
    • 2

    Putting Javascript into External File

    My Javascript knowledge is practically nil - I have created a drop down menu in Fireworks, which then converts into Javascript etc in Dreamweaver, I have worked out how to put the code from the header and the body tag into an external Javascript file but can't work out how to put the main part of the code in the body which has all the codes such as the <td> tags etc into one (if I can at all). I have attached some of the code from the page as a txt file.

    Thanks
    Attached Files
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5390

    #2
    you cannot mixup the script-include techniques that way ... when you put the JavaScript code in an external file - which is good practice and thus should be done - then the code is just included where you put it. if some code needs to be applied then to the page, some nodes or whatever ... the code would need to be prepared for that ... which means: the code might create the nodes itself or functions need to run after the page was loaded and then apply handlers or whatever to nodes that you would need to retrieve from the DOM.

    I doubt that using the tools that you mentioned will allow to do such things easyly ... basicly ... and that is just my point of view ... those tools just create messy JavaScript-code ... i wouldn't ever use them ... but if you do ... i would suggest to use the code that they produce as it comes out ... fiddling with those messy things is just annoying ... of course you might do it ... but the time used to get that result might be the same as when writing a clear structured and optimized script from scratch ...

    kind regards

    Comment

    Working...