if i have an array in an external js file such as:
var blah = new Array();
blah[0] = "sumthing";
blah[1] = "...";
blah[2] = "=D";
how would i create a document that displays the array?
if i have an array in an external js file such as:
var blah = new Array();
blah[0] = "sumthing";
blah[1] = "...";
blah[2] = "=D";
how would i create a document that displays the array?
Code:document.write(blah.toString())
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
thanx a lot ^^
sorry but another question on arrays...just say my array was:
var answer = new Array();
answer[0] = "yes";
answer[1] = "no";
answer[2] = "maybe";
answer[3] = "yes";
answer[4] = "yes";
how would i display only the values that are "yes"?
This is sort of silly because there are many ways to do this and I have no idea why you are doing it. That would influence my choice of methods. This is one way:
Code:var str='' for (var i_tem = 0; i_tem < answer.length; i_tem++) if ( answer[i_tem]=='yes' ) str += answer[i_tem]+' ' document.write(str)
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Bookmarks