From Staredit Network Wiki
Jump to: navigation, search

What is Javascript?

JavaScript is a scripting language most often used for client-side web development. It is a dynamic, weakly typed, prototype-based language with first-class functions. JavaScript was influenced by many languages and was designed to look like Java, but be easier for non-programmers to work with.

What does that mean?

Javascript is an easy to use coding language that is un-compiled and all that is required is notepad. Simply name any file with the extension .js and you are now able to run the file. With this and its ability to output a file with information in it, we can produce lines of code with only a few lines.

So, how easy is it?

Well, its so simple that you use it for everything -- from triggers to scripting.

First, open up Notepad and add this:

var fso = new ActiveXObject("Scripting.FileSystemObject");
var outputFileName = fso.GetParentFolderName(WScript.ScriptFullName) + "\\" + fso.GetBaseName(WScript.ScriptFullName) + ".txt";
var outputStream = fso.CreateTextFile(outputFileName, true);

Now, we can output lines to a file. Let’s just make it output “HI!” 50 times:

for(var I = 0; I<50; I++){

And we close the document like a good little boy:


And its just that simple! Now, for even better results, you can move onto Tips for Tedious Coding.