Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to pass parms

Status
Not open for further replies.

wwcbill

Programmer
Jul 31, 2002
11
US
I am new to Java Script and I am having a hard time trying to pass a parm to a function. I have written a script, but it dose not work, Why, Pleas help:
<HTML>
<HEAD>
<TITLE>Title of your page</TITLE>
<META NAME=&quot;generator&quot; CONTENT=&quot;ToniArts EasyHtml v.2.2&quot;>
<script LANGUAGE=&quot;javascript&quot;>
function testFunc( one, two) {
document.write( &quot;<tr>&quot;);
document.write( &quot;<td>&quot; + one + &quot;</td>&quot;);
document.write( &quot;<td>&quot; + two + &quot;</td>&quot;);
document.write( &quot;<tr>&quot;);
}
</script>


</HEAD>
<BODY>
cont = 100
bont = 210
while (cont > 0) {
testFunc(cont, bont);
cont -= 10;
}
</BODY>
</HTML>
 
<HTML>
<HEAD>
<TITLE>Title of your page</TITLE>
<META NAME=&quot;generator&quot; CONTENT=&quot;ToniArts EasyHtml v.2.2&quot;>
<script LANGUAGE=&quot;javascript&quot;>
function testFunc( one, two) {
document.write( &quot;<tr>&quot;);
document.write( &quot;<td>&quot; + one + &quot;</td>&quot;);
document.write( &quot;<td>&quot; + two + &quot;</td>&quot;);
document.write( &quot;<tr>&quot;);
}
</script>

See the difference.

</HEAD>
<BODY>
<table border=&quot;1&quot;>
<script>
cont = 100
bont = 210
while (cont > 0) {
testFunc(cont, bont);
cont -= 10;
}
</script>
</table>
</BODY>
</HTML>

Regards,
Sergey Smirnov
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top