Also, just to dig in to your code a bit further (hope you don’t mind)
You don’t need to use “new Array()” to instantiate arrays, square brackets will do the job
var anArray = ["item 1", "item 2", "item 3"];
“document.write” and it’s variants are usually poor for performance, if you’re just testing stuff it doesn’t matter too much, but it’s not the best habit to get in to.
When you’re injecting content; where possible, it’s better to inject 1 big chunk than several smaller ones.
You could use innerHTML for example to add content to the page
Let’s say you have a <div id=“test”></div> in your body section somewhere, you could then do something along the following lines:
function addtext() {
var openURL= ["http://google.com", "http://yahoo.com", "http://www.msn.com", "http://www.bing.com"];
var htmlStr = '<table>';
for (i=0;i<=openURL.length-1;i++){
htmlStr += '<tr><td>' + openURL[i] + '</td></tr>';
}
htmlStr += '</table>';
document.getElementById("test").innerHTML = htmlStr;
}
When you’re passing in openURL[i] you’ll need to not escape the single quotes. At the moment you’re effectively putting the string “openURL[i]” in window.open.