Home Take the Virtual Tour to Be An Affiliate Sign Up Now - Make Money Learn About the Affiliate Program Corporation - Affiliate Info & Support Affiliate News & Tutorials Casino Software Products
 Money from Home

 


» Tutorials for the Affiliate Intermediate

To use JavaScript's you need to know how to differentiate a JavaScript from regular HTML code. How do you recognize a JavaScript? Simple, you need to look for the tags. All JavaScript code have 2 tags <SCRIPT> at the beginning and </SCRIPT> at the end.


The opening tag is usually like this: <SCRIPT language="JavaScript">

The language="JavaScript" command is there so the browser can recognize that the code that is following is in JavaScript and not another scripting language, ex.: Visual Basic Script. VBScript.

<SCRIPT language="JavaScript">
// -- JavaScript Code --
</SCRIPT>

There is no limit in the number of scripts that an HTML page can contain. Don't forget to always close your tags before continuing. Functions inside the <HEAD> </HEAD>tags of your document are JavaScript functions (we'll get to this in the next tutorials). We always put these functions between the <HEAD> </HEAD> tags, this way your functions are loaded before the page begins to display, and you won't see all kinds of JavaScript errors.

<HEAD>
<TITLE>Your Title</TITLE>
<SCRIPT language="JavaScript">
function xxxxx()
{
JavaScript Stuff...
a }
</SCRIPT>
</HEAD

Before we begin writing scripts, we need to do something first. Old browsers are unable to read the <SCRIPT> tags. Instead of executing the JavaScript, they will display just the text. To solve this problem, we have to trick the browser into ignoring the text between the <SCRIPT> tags. HTML comments will be used, the older browsers will ignore the text inside the comments, but a JavaScript capable browsers will go ahead and perform your script. Here is how to do it:

<SCRIPT language="JavaScript">
<!-- This opens the HTML comments that will hide the script from old browsers
......JavaScript Statements.......
//--> This closes the comment section and the browser will read on normally
</SCRIPT>



What can a JavaScript Do?

  1. JavaScript gives HTML designers a programming tool
    • HTML authors are normally not programmers but JavaScript is a scripting language with a very simple syntax!
    • Almost anyone can put small "snippets" of code into their HTML pages
  2. JavaScript can put dynamic text into an HTML page
    • A JavaScript statement like this: document.write("<h1>" + name + "</h1>") can write a variable text into an HTML page
  3. JavaScript can react to events
    • A JavaScript can be set to execute when something happens, like when a page has finished loading or when a user clicks on an HTML element
  4. JavaScript can read and write HTML elements
    • A JavaScript can read and change the content of an HTML element
  5. JavaScript can be used to validate data
    • A JavaScript can be used to validate form data before it is submitted to a server this will save the server from extra processing
  6. JavaScript can be used to detect the visitor's browser
    • A JavaScript can be used to detect the visitor's browser, and - depending on the browser - load another page specifically designed for that browser
  7. JavaScript can be used to create cookies
    • A JavaScript can be used to store and retrieve information on the visitor's computer

 


» News Feed

  • Latest Games
  • U.S. Players- Info
  • Affiliate Payments
  • CPA Deal

» Tutorials

  Gambling Federation online casino affiliate network

Affiliate Agreement
| Frequently Asked Questions | Partnered Sites | Friendly Links | Contact Support