Click to See Complete Forum and Search --> : noob needs help!


noelisevil
02-24-2003, 01:49 AM
im very novice with javascript and need some help with this.
Everything seems to be working the way its suppost to except the third line I cant get it to function, the numbers stay the same and dont add a new digit to each new line it creates. Did i lose you? But the forth line works perfect. Sorry if this is such a dumb question :-\



<script type="text/javascript">

for (i = 6685500; i <= 6686000; i++);
for (ii = 6685500; ii <= 6686000; ii++)
{
document.write("<a href=http://www.webpage.com/Scripts/ENTER.asp?class_id=" + i + "&kkey1=" + ii + "&kkey2=546993317' target='right'>" + i + "</a><br>" )
}

</script>

tomei
02-24-2003, 02:48 AM
I think this is what you want


<script type="text/javascript">

for (i = 6685500; i <= 6686000; i++)
{
for (ii = 6685500; ii <= 6686000; ii++)
{
document.write("<a href=http://www.webpage.com/Scripts/ENTER.asp?class_id=" + i + "&kkey1=" + ii + "&kkey2=546993317' target='right'>" + i + "</a><br>" )
}
}
</script>

noelisevil
02-24-2003, 03:02 AM
hmm that one just overflows the page and explorer asks to close it before it freezes :(

See the first script i have works and i havent gotten any errors with it and will post the numbers correctly with the digits adding after &kkey1 but it wont do the same for after my class_id. Its suppost to add one digit to each as well as post this onto the page but im not sure how to arrange things or if i got something in there wrong :-\

tomei
02-24-2003, 03:31 AM
Is this the outcome you want?

<a href=http://www.webpage.com/Scripts/ENTER.asp?class_id=6685500&kkey1=6685500&kkey2=546993317' target='right'>6685500</a>
<a href=http://www.webpage.com/Scripts/ENTER.asp?class_id=6685501&kkey1=6685501&kkey2=546993317' target='right'>6685501</a>
.
.
.
<a href=http://www.webpage.com/Scripts/ENTER.asp?class_id=6686000&kkey1=6686000&kkey2=546993317' target='right'>6686000</a>

if yes then try this

for (i = 6685500; i <= 6686000; i++)
{
document.write("<a href=http://www.webpage.com/Scripts/ENTER.asp?class_id=" + i + "&kkey1=" + i + "&kkey2=546993317' target='right'>" + i + "</a><br>" )
}

noelisevil
02-24-2003, 03:53 AM
omg thank you, perfect
i cant believe the brain f@rt i was having

noelisevil
02-24-2003, 04:00 AM
i have one last question, who if i want the out come to be offset by 2 maybe?
Like the class_id to be say 2 digits behind the kkey1? Is that even possible?





say like the class was 6686000 adding just one digit and i had my kkey1 at 6686002 adding one digit

tomei
02-24-2003, 06:02 AM
Yes possible

for (i = 6685500; i <= 6686000; i++)
{
document.write("<a href=http://www.webpage.com/Scripts/ENTER.asp?class_id=" + i + "&kkey1=" + (i+2) + "&kkey2=546993317' target='right'>" + i + "</a><br>" )
}

Charles
02-24-2003, 06:19 AM
You can also use the following:

for (var i = 6685500, var j = 6685502; i <= 6686000; i++, j++)
{
document.write('<a href="http://www.webpage.com/Scripts/ENTER.asp?class_id=', i '&kkey1=', j, '&kkey2=546993317" target="right">', i, '</a><br>')
}