hobbit monitor
Closed Thread
Results 1 to 5 of 5

Thread: What program can i use to write a javascript code in?

  1. #1
    Join Date
    Nov 2009
    Posts
    3

    What program can i use to write a javascript code in?

    Take your pick of any of these that allows editing code in source view mode as well as visual editor mode. Save file with html extension and you'll be able to view it in your web browser. Just drag/drop saved file into an open browser window.

  2. #2
    fayas666 Guest
    You donít need any special software to write JavaScript. All you need is a plain text editor and a web browser. Code written in JavaScript must be executed from a document written in (X)HTML. There are two ways of doing this. You can place the JavaScript between <script> tags within the <head> of the document:

    <!DOCTYPE html PUBLIC "-//W*C//DTD XHTML *.*//EN"
    "http://www.w*.org/TR/xhtml**/DTD/xhtml**.dtd">
    <html>
    <head>
    <script type="text/javascript">
    JavaScript goes here...
    </script>
    </head>
    <body>
    Mark-up goes here...
    </body>
    </html>

    If youíd like to try the examples in this chapter, go ahead and create two files in a text editor. First, create a simple bare-bones HTML or XHTML file. You can call it something like test.html. Make sure that it contains a <script> tag in the <head> that has a src attribute with a value like example.js. Thatís the second file you can create in your text editor. Your test.html file should look something like this:

    <!DOCTYPE html PUBLIC "-//W*C//DTD XHTML *.*//EN"
    "http://www.w*.org/TR/xhtml**/DTD/xhtml**.dtd">
    <html xmlns="http://www.w*.org/****/xhtml" xml:lang="en">
    <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>Just a test</title>
    <script type="text/javascript" src="example.js">
    </script>
    </head>
    <body>
    </body>
    </html>

    You can copy any of the examples in this chapter and write them into example.js. None of the examples are going to be particularly exciting, but they may be illuminating. In later chapters, Iíll be showing you how to use JavaScript to alter the behavior and content of your document. For now, Iíll be using simple dialog boxes to display messages. Whenever you change the contents of example.js, you can test its effects by reloading test.html in a web browser. The web browser will interpret the JavaScript code immediately. Programming languages are either interpreted or compiled. Languages like Java or C++ require a compiler. A compiler is a program that translates the source code written in a high-level language like Java into a file that can be executed directly by a computer. Interpreted languages donít require a compileróthey just need an interpreter instead. With JavaScript, in the context of the World Wide Web, the web browser does the interpreting. The JavaScript interpreter in the browser executes the code directly from the source. Without the interpreter, the JavaScript code would never get executed. If there are any errors in the code written in a compiled language, those errors will pop up when the code is compiled. In the case of an interpreted language, errors wonít become apparent until the interpreter executes the code. Although compiled languages tend to be faster and more portable than interpreted languages, they often have a fairly steep learning curve. One of the nice things about JavaScript is that itís relatively easy to pick up.
    ___________________________________________________
    [url=http://www.foxyfishnets.com/fishnet-lingerie.html]fishnet lingerie[/url]
    [url=http://www.thewatchprofessionals.com/replica-watch/hublot/*.html]Hublot BigBang replica watch[/url]

  3. #3
    easellUnano Guest

    What program can i use to write a javascript code in

    Starting off the first thread here i guess.

    I can only really code in Java and then i have to run it through the compiler half a dozen times to get it to work properly :P

    I can also do simple HTML and i can understand PHP but not write it myself.

  4. #4
    jolies Guest
    A script written in JavaScript, or any other programming language, consists of a series of instructions. These are called statements. These statements must be written with the right syntax in order for them to be interpreted correctly. Statements in JavaScript are like sentences in English. They are the building blocks of any script. Whereas English grammar demands that sentences begin with a capital letter and end with a period, the syntax of JavaScript is much more forgiving. You can simply separate statements by placing them on different lines: first statement second statement If you place a number of statements on the same line, you must separate them with semicolons like this: first statement; second statement; However, it is good programming practice to place a semicolon at the end of every statement even if they are on different lines: first statement; second statement; This helps to make your code more readable. Putting each statement on its own line makes it easier to follow the sequence that your JavaScript is executed in.
    ====================
    [url=http://www.affiliateleap.com/]affiliate tips[/url]
    [url=http://www.linkpointsource.com]link point[/url]

  5. #5
    Join Date
    Jan 2010
    Posts
    2
    JSLint is a JavaScript program that looks for problems in JavaScript programs. It is a code quality tool.

    When C was a young programming language, there were several common programming errors that were not caught by the primitive compilers, so an accessory program called lint was developed that would scan a source file, looking for problems.

    As the language matured, the definition of the language was strengthened to eliminate some insecurities, and compilers got better at issuing warnings. lint is no longer needed.

    JavaScript is a young-for-its-age language. It was originally intended to do small tasks in webpages, tasks for which Java was too heavy and clumsy. But JavaScript is a very capable language, and it is now being used in larger projects. Many of the features that were intended to make the language easy to use are troublesome for larger projects. A lint for JavaScript is needed: JSLint, a JavaScript syntax checker and validator.

    JSLint takes a JavaScript source and scans it. If it finds a problem, it returns a message describing the problem and an approximate location within the source. The problem is not necessarily a syntax error, although it often is. JSLint looks at some style conventions as well as structural problems. It does not prove that your program is correct. It just provides another set of eyes to help spot problems.

    JSLint defines a professional subset of JavaScript, a stricter language than that defined by Third Edition of the ECMAScript Programming Language Standard. The subset is related to recommendations found in Code Conventions for the JavaScript Programming Language.

    JavaScript is a sloppy language, but inside it there is an elegant, better language. JSLint helps you to program in that better language and to avoid most of the slop.
    _________________________________________
    [url=http://www.dekomount.co.uk]tv wall bracket[/url]
    [url=http://www.e***rd24.de]e***rd[/url]

Closed Thread

Similar Threads

  1. Javascript countdown timer code free...
    By JackieBolinsky in forum Internet Privacy
    Replies: 0
    Last Post: 02-23-2012, 02:45 AM
  2. Free JavaScript Code Downloads
    By JavaScriptBank in forum Programming
    Replies: 27
    Last Post: 02-15-2010, 05:57 AM
  3. Quick PHP Code Tester Program
    By JayT in forum Programming
    Replies: 8
    Last Post: 03-24-2008, 12:03 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts