上个页面得到的值判断?
1.
<script language= "javascript ">
function abc()
{
var the_unevaled_answer = "2 + 3 ";
var the_evaled_answer = eval( "2 + 3 ");
alert( "the un-evaled answer is " + the_unevaled_answer + " and the evaled answer is " + the_evaled_answer);
}
</script>
<form>
<input type= "button " onclick= "abc() ">
<input type= "text " value= "1 " id= "abc ">
<a href= "实验.html "> 在 </a>
</form>
2.
<script language= "javascript ">
function yuan()
{
if(window.parent.abc.value== "1 ")
alert( "吃屎 ");
}
</script>
<select>
<option> 1 </option>
<option selected> 2 </option>
</select>
<body onLoad= "yuan(); ">
</body>
哪儿错了,我是按照某个网友说的做的
随面问一下
------解决方案--------------------if(window.parent.abc.value== "1 ")改成if(window.parent.document.all.abc.value== "1 ")
估计那哥们写的时候没有加form、body吧。