这一句js太无敌了,谁能找出问题所在======在线等?
//底下这一句有语法错误
document.getElementById("s_brand").innerHTML+=" <a href=\"javascript:void(0)\" onClick=\"parent.setCenter(3,'IJRVFFZVIWBAI','"+splitToText(xBrand[currentXilieID][i]+"','730');return false;\">"+splitToText(xBrand[currentXilieID][i]+"</a>");
措就错在setCenter(3,'IJRVFFZVIWBAI','"+splitToText(xBrand[currentXilieID][i]+"','730');
我把他替换成setCenter(3,'IJRVFFZVIWBAI','南京','730'); 他就通过了,注意我没有替换后面的
return false;\">"+splitToText(xBrand[currentXilieID][i]+"</a>");中的splitToText(xBrand[currentXilieID][i];证明这不是splitToText(xBrand[currentXilieID][i]提不出来值的问题,而是
setCenter(3,'IJRVFFZVIWBAI','"+splitToText(xBrand[currentXilieID][i]+"','730');
语法的问题,
谁能解决?
------解决方案--------------------'"+splitToText(xBrand[currentXilieID][i]+"'
我觉得是这个地方写法有问题.你在''中如果再放''就是按就近的原则了.
没办法帮你试验.只是个猜测.
或者你直接setCenter(3,'IJRVFFZVIWBAI','"+splitToText(xBrand[currentXilieID][i]+"','730'); 改成
setCenter(3,'IJRVFFZVIWBAI',splitToText(xBrand[currentXilieID][i],'730');
------解决方案--------------------JScript code
document.getElementById('s_brand').innerHTML+=' <a href="javascript:void(0)" onClick="parent.setCenter(3,\'IJRVFFZVIWBAI\',\''+splitToText(xBrand[currentXilieID][i]+'\',\'730\');return false;"> '+splitToText(xBrand[currentXilieID][i]+' </a> ');
------解决方案--------------------
document.getElementById("s_brand").innerHTML+=" <a href=\"javascript:void(0)\" onClick=\"parent.setCenter(3,'IJRVFFZVIWBAI','"+splitToText(xBrand[currentXilieID][i])+"','730');return false;\"> "+splitToText(xBrand[currentXilieID][i])+" </a> ";