Only logged in members can reply and interact with the post.
Join SimilarWorlds for FREE »

Anyone good with HTML and Javascript?

I need to include multiple Javascript files into a HTML without using jQuery if anyone knows how to do that.. that'd be awesome.
Could you please specify what you mean by include JS files?

The way I know it, you can include JS files by simply writing <script src="myscript.js"></script> for each script in hierarchical order.
If you don't want an ugly HTML page full of these <script> tags, you could use a tool like webpack.
@Samael: Yes, JS scripts run in order of dependence, so if script2 depends on script1, then script1 needs to be written first. If however script2 fails to parse correctly, then there must be something wrong with it.

You should find out why by inspecting the Javascript console's messages:
In Chrome/Firefox: Ctrl+Shift+J or F12

Alternatively as a small debug test, you could write alert('script2 testing'); in your second script to see if your HTML page loads that correctly.

There's also a tool to tell you if your JS script conforms to the rules and tell you what's right or wrong with it:
http://www.jslint.com/
This one is better: http://jshint.com/
Thanks a lot! I really appreciate you taking the time to help me out! I'll give those things a try.
@Samael: I'll be back later. I hope it works out for you. I'll read the replies later.

 
Post Comment