Home » Posts tagged "Learn Java Script Online" (Page 3)

Learn Working with Variables in Java Script, Lesson 13

  Working with Variables I have to go over a few more things relating to variables before we move on. These important aspects of variables include the rules that govern the naming of variables and how to define variable scope. Rules for Variable Names Keep the following rules in mind when creating variables: Variable names can consist only of uppercase and lowercase letters, the underscore character, and the numbers 0 through...
Continue reading »

Learn Working with Values in Java Script, Lesson 12

  Working with Values JavaScripts and JScripts store information as values. For example, if you were to create a form for your users to fill out, each entry in the form would contain a separate value. Your scripts can store these values in variables and then use the variables throughout your script. The list of the types of values supported by JavaScript and JScript. JAVASCRIPT AND JSCRIPT VALUES Value    ...
Continue reading »

Learn How to Hiding JavaScript Statements , Lesson 10

    HTML comments begin with the characters <!– and end with –>. The browser knows not to display anything between these sets of characters. You also know that the HTML <SCRIPT> tag is used to embed JavaScript into HTML pages. Both JavaScript and non-JavaScript browsers know not to display the <SCRIPT> tags. However, non-JavaScript browsers do not know what to make of the statements within the <SCRIPT> tags, so they...
Continue reading »

How to Place JavaScript in an HTML Tag

  JavaScript can also be placed within HTML tags, as shown in the following example. <BODY onLoad=document.write(“Hello World!”)> </BODY> In this example, the JavaScript onLoad=document.write(“Hello World!”) statement has been added to the HTML <BODY> tag. This particular JavaScript statement tells the browser to write the enclosed text when the browser first loads the HTML page. Placing small JavaScript statements inside HTML tags provides an easy way to execute small pieces of...
Continue reading »

Learn how to Referencing JavaScript in an External .js File

    To store your JavaScripts in external files, you need to save them as plain text files with a .js file extension. You then need to add the SCR attribute to the opening <SCRIPT> tag in your HTML page as demonstrated here. <SCRIPT SRC=”Test.js” LANGUAGE=”JavaScript” TYPE=”Text/JavaScript”> </SCRIPT> In this example, an external JavaScript named Test.js has been specified. This external JavaScript can contain any number of JavaScript statements. However, it...
Continue reading »

Learn how to Placing JavaScripts in the Head Section of the HTML page.

JavaScripts also can be placed anywhere within the head section of your HTML pages. Unlike scripts embedded within the body section of HTML pages, scripts embedded in the head section are not necessarily automatically executed when the page loads. In some cases, they are executed only when called for execution by other statements within the HTML page. Most JavaScript programmers move all functions and most variables to the head section because...
Continue reading »

Learn Different Ways to Integrate JavaScript into Your HTML Pages.

  As you know, there are two places you can put your JavaScripts in an HTML page: in either the head or body section. In addition, I have told you that you can either embed JavaScript directly into the HTML page or reference it in as an external .js file. One more way you can integrate JavaScript into an HTML page is as a component in an HTML tag. Placing JavaScripts...
Continue reading »

Learn about JavaScript and Case Sensitivity.

You have to be extremely careful when keying in the text of your JavaScripts. JavaScript is a case sensitive programming language (unlike HTML, which enables you to use different capitalization when defining HTML tags). Case sensitivity means that you must type JavaScript elements exactly as they appear in this book in order for them to work. For example, as far as JavaScript is concerned, the words document and Document refer to...
Continue reading »