js中怎样循环打开很多个页面,请帮帮我。
我想循环打开很多个页面,我写了代码,可是总是只打开一个页面。请大家帮我看看。
<script language="javascript">
function delet()
{
var j=0;
var f = document.all("form1");
var strWin="";
for (i=0;i<f.elements.length;i++)
{
if (f.elements[i].name.indexOf("chk_Show") != -1)
{
if (f.elements[i].checked == true)
{
var url ="person_search_results.aspx?postid=" + f.elements[i+1].value + "&company_id="+f.elements[i+2].value ;
strWin = "newbrown"+i;
window.open(url,strWin);
}
}
}
}
</script>
------解决方案--------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<script type="text/javascript">
var arr=new Array();
arr[0]="http://sohu.com"
arr[1]="http://yahoo.com.cn"
arr[2]="http://google.com.cn"
for(i=0;i<arr.length;i++)
{
window.open(arr[i]);
}
</script>
</body>
</html>