Please Reload

Lesson 2 of BudgetByte Script

Lesson One

Sometimes a pattern of variables

will be used several times

in one script.

So instead of writing the same

string many times

we put the string into its own variable.

Here are the basic variables for the above:

var a = "<td bgcolor=sienna height=20 width=20>";
var b = "<td bgcolor=white height=20 width=20>";
var d = "<table cellspacing=0 cellpadding=0>"; 
var f = "</td><td>";
var g = "</td></table>";

The first row would be written:


But so would rows three, five,

seven, and nine....

So we are going to use that string five times...

To make it easier

we make that string a variable...

var A= d+a+f+b+f+a+f+b+f+a+f+b+f+a+f+b+f+a+f+b+g;

NOTE:::No Quote Marks....

These represent variables NOT html.

ONLY html gets quotes around it.

The same holds true for the second row.

It will also be row four, six, eight, and ten.

We will use that string also five times.

So we make it a variable

as we did the first string

and name it something different.

var B = d+b+f+a+f+b+f+a+f+b+f+a+f+b+f+a+f+b+f+a+g;

In the textbox below

the code for the checkerboard

has been written for you

nesting the variables as has been shown.

All you have to do is complete the string!!

Good Luck !!

Banner by Bodacious