How to Test JavaScripts
JavaScript code is great for creating interactive content on your website, but implementing it can be a lengthy process. Even after you have the code, you may have to do quite a bit more to work it into your HTML. For that reason, you certainly want to know that the JavaScript code is good before you go adding it to everything else. There are several sites that will let you test JavaScript code.
Instructions
-
-
1
Test your JavaScript at jsFiddle (see Resources). The lower-left hand box on this site lets you paste your JavaScript to test it. Click "Run" at the top bar and you will see the result of the code appear to the right of the JavaScript. You can "fiddle" around with it (hence the site name) in the left pane and keep updating it by hitting "Run" until it works.
-
2
Test your JavaScript at JSLint (see Resources). This site allows you to paste the code in the box and then view it below after clicking "JSLint." While you lose the ability to see the code and product side-by-side, you gain a result that is as wide as a normal computer screen. For code that takes up the width of the screen, this might display it more accurately than the narrow jsFiddle window would.
-
-
3
Test your JavaScript at WriteCodeOnline (see Resources). For users writing simple text JavaScript, this site offers the quickest, most functional setup. It works in a similar manner to the other two, but the basic interface lets you modify and run the code as quickly as maximum speed.
-
1
References
Resources
- Photo Credit Erik Snyder/Lifesize/Getty Images