日期:2014-05-16  浏览次数:20354 次

大家帮忙看一下,这段代码有问题吗?
<script   language= "JavaScript "   type= "text/javascript ">
  function   checkpic(ap){
    var   j
    if   (ap)!== " "){
    for   (j=0   ;j <10;j++)
    {
    document.write   " <img   name= "picimage "   id= "image "   src= " <%=root(j)%> "   width= "10% "   height= "72 "   alt= " "   /> "}
    }
    }
    </script>
    <script   language= "JavaScript "   type= "text/javascript "> checkpic(root) </script>

------解决方案--------------------
<script language= "JavaScript " type= "text/javascript ">
function checkpic(ap){
var j//分号
if (ap)!== " "){//括号有问题吧
for (j=0 ;j <10;j++)
{
document.write " <img name= "picimage " id= "image " src= " <%=root(j)%> " width= "10% " height= "72 " alt= " " /> "}//用 <%%> 也会有问题,可能导致IE变慢
}
}
</script>
<script language= "JavaScript " type= "text/javascript "> checkpic(root) </script>