日期:2014-05-18  浏览次数:20484 次

windows.open的js条件传值语句怎么写
HTML code
<a href="javascript:void(null)" onclick='xx(<%#Eval("number")%>)'>





JScript code
function xx(num){
if(num==10)
window.open('main.aspx',null,'toolbar=no,menubar=yes, scrollbars=yes, resizable=yes,location=no, status=no,top=0,left=0,right=0,width=750,height=620');
if(num>10)
window.open('main1.aspx',null,'toolbar=no,menubar=yes, scrollbars=yes, resizable=yes,location=no, status=no,top=0,left=0,right=0,width=750,height=620');

}  


我现在要实现,跳转页面的时候传值num1=<%#Eval("number")%>&fk=<%#Eval("fankui")%>&sh=<%#Eval("shenhe")%>

传值的这个代码写在js里呢?还是写在哪里?谢谢,小菜鸟一枚

------解决方案--------------------
<a href="javascript:void(null)" onclick=xx(<%#Eval("number")%>,'<%#Eval("fankui")%>','<%#Eval("shenhe")%>')>

function xx(num,x1,x2){
u = 'main.aspx'
if(num>10)
u = 'main1.aspx'

u+="?num1="+num + "&fk="+encodeURIComponent(x1) + "&sh=" + encodeURIComponent(x2);

var sp = 'toolbar=no,menubar=yes, scrollbars=yes, resizable=yes,location=no, status=no,top=0,left=0,right=0,width=750,height=620';

window.open(u,null,sp);

}