469,361 Members | 2,264 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,361 developers. It's quick & easy.

Putting Javascript into External File

2
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
File Type: txt page.txt (22.5 KB, 5050 views)
May 1 '10 #1

✓ answered by gits

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

1 1339
gits
5,390 Expert Mod 4TB
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
May 2 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by George Ziniewicz | last post: by
1 post views Thread by mr_burns | last post: by
4 posts views Thread by Pat | last post: by
2 posts views Thread by Matt Weaver | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.