Skip to main content

Home/ Groups/ Learning Library
Sunny Jackson

Audrey Hepburn - 0 views

Sunny Jackson

Dustin Hoffman - 0 views

Sunny Jackson

Franz Kafka - 0 views

Sunny Jackson

John Keats - 0 views

Sunny Jackson

Jane Addams - 0 views

Sunny Jackson

Bella Abzug - 0 views

Sunny Jackson

Eleanor Baum - 0 views

Sunny Jackson

Ruth Benedict - 0 views

Sunny Jackson

Virginia Apgar - 0 views

Sunny Jackson

JavaScript How To - 0 views

  • The HTML <script> tag is used to insert a JavaScript into an HTML page.
  • <script type="text/javascript"> document.write("Hello World!"); </script>
  • how to add HTML tags to the JavaScript: Example <html> <body> <script type="text/javascript"> document.write("<h1>Hello World!</h1>"); </script> </body> </html>
  • ...4 more annotations...
  • By entering the document.write command between the <script> and </script> tags, the browser will recognize it as a JavaScript command and execute the code line.
  • The document.write command is a standard JavaScript command for writing output to a page.
  • the <script type="text/javascript"> and </script> tells where the JavaScript starts and ends
  • Browsers that do not support JavaScript, will display JavaScript as page content. To prevent them from doing this, and as a part of the JavaScript standard, the HTML comment tag should be used to "hide" the JavaScript. Just add an HTML comment tag <!-- before the first JavaScript statement, and a --> (end of comment) after the last JavaScript statement
Sunny Jackson

JavaScript Introduction - 0 views

  • A scripting language is a lightweight programming language
  • Java and JavaScript are two completely different languages in both concept and design!
Sunny Jackson

JavaScript Where To - 0 views

  • JavaScripts in a page will be executed immediately while the page loads into the browser.
  • Scripts to be executed when they are called, or when an event is triggered, are placed in functions.
  • put all your functions in the head section, this way they are all in one place and do not interfere with page content.
  • ...8 more annotations...
  • <head> <script type="text/javascript"> function message() { alert("This alert box was called with the onload event"); } </script> </head>
  • Scripts placed in the body section are often used to display page content while the page loads.
  • JavaScript can also be placed in external files.
  • External JavaScript files often contains code to be used on several different web pages.
  • External JavaScript files have the file extension .js
  • External script cannot contain the <script></script> tags!
  • To use an external script, point to the .js file in the "src" attribute of the <script> tag:
  • <script type="text/javascript" src="xxx.js"></script>
Sunny Jackson

JavaScript Statements - 0 views

  • JavaScript is Case Sensitive
  • A JavaScript statement is a command to a browser. The purpose of the command is to tell the browser what to do.
  • It is normal to add a semicolon at the end of each executable statement.
  • ...6 more annotations...
  • Using semicolons makes it possible to write multiple statements on one line.
  • JavaScript code (or just JavaScript) is a sequence of JavaScript statements.
  • Each statement is executed by the browser in the sequence they are written.
  • JavaScript statements can be grouped together in blocks. Blocks start with a left curly bracket {, and ends with a right curly bracket }.
  • The purpose of a block is to make the sequence of statements execute together.
  • Normally a block is used to group statements together in a function or in a condition (where a group of statements should be executed if a condition is met).
Sunny Jackson

JavaScript Comments - 0 views

  • Comments can be added to explain the JavaScript, or to make the code more readable. Single line comments start with //.
  • Multi line comments start with /* and end with */.
  • In the following example the comment is used to prevent the execution of a single code line (can be suitable for debugging): Example <script type="text/javascript"> //document.write("<h1>This is a heading</h1>");
  • ...2 more annotations...
  • In the following example the comment is used to prevent the execution of a code block (can be suitable for debugging): Example <script type="text/javascript"> /* document.write("<h1>This is a heading</h1>"); document.write("<p>This is a paragraph.</p>"); document.write("<p>This is another paragraph.</p>"); */
  • In the following example the comment is placed at the end of a code line: Example <script type="text/javascript"> document.write("Hello"); // Write "Hello" document.write(" Dolly!"); // Write " Dolly!"
Sunny Jackson

JavaScript Variables - 0 views

  • Variables are "containers" for storing information.
  • variables can be used to hold values (x=5) or expressions (z=x+y).
  • A variable can have a short name, like x, or a more descriptive name, like carname.
  • ...8 more annotations...
  • Rules for JavaScript variable names: Variable names are case sensitive (y and Y are two different variables) Variable names must begin with a letter or the underscore character
  • Creating variables in JavaScript is most often referred to as "declaring" variables.
  • You can declare JavaScript variables with the var keyword: var x; var carname;
  • they have no values yet
  • you can also assign values to the variables when you declare them: var x=5; var carname="Volvo";
  • When you assign a text value to a variable, use quotes around the value.
  • If you assign values to variables that have not yet been declared, the variables will automatically be declared.
  • These statements: x=5; carname="Volvo"; have the same effect as: var x=5; var carname="Volvo";
« First ‹ Previous 321 - 340 of 737 Next › Last »
Showing 20 items per page