I understand that I can execute code in a .js file at a certain location in my html file by <javascript src=...> type code but, how can I execute certain code in the external file if it's not in a function and I have more than just one set of instructions in that file? Can I do this? i.e. I have an applet code that I wish to run in 2 different places in my html file. They will use different parameters. Instead of writing 2 different .js files with a bunch of doc.writelines in each, how can I put them both into one file and just execute the portion that's needed at either place in my html file? Hope I've explained this well enough. Thank you