function btn_ok_onclick(Profess,Colleges) { document.writeln('<img alt="三方签约统计图表" src="SignatureChart.ashx?type=pie&width=300&height=300&subtitle=学生三方签约&mp_oper=0&id="+escape(Profess)+"&val="+escape(Colleges)/>'); 
}各位给看看 接收到的Profess,Colleges为空值  传变量的时候该怎么写

解决方案 »

  1.   

    encodeURI("汉字");
    这个好象也有用
      

  2.   

    id="+escape(Profess)+"&val="+escape(Colleges)   就这部分错了 前边没错 只有 Profess  Colleges是变量 
      

  3.   

    Profess Colleges
    是C#的还是JS的还是什么呀?
      

  4.   

    js页  下一页是C#获取变量值
      

  5.   

    string Profess = null == context.Server.UrlDecode(Request["id"]) ? null : context.Server.UrlDecode(Request.QueryString["id"].ToString());            string Colleges = null == context.Server.UrlDecode(Request["val"]) ? null : context.Server.UrlDecode(Request.QueryString["val"].ToString());
    我用上边这两条 获取的传入的变量 但都是空值
      

  6.   

    用escape是没有问题的。应该是你的document.writeln的问题。你直接在页面上操作Dom对象,为什么要document.writeln?
    用createElement("IMG")创建一个Img对象,然后在给它赋值各个属性,或者直接某个容器控件的innerHTML直接='<img alt="三方签约统计图表" src="SignatureChart.ashx?type=pie&width=300&height=300&subtitle=学生三方签约&mp_oper=0&id="+escape(Profess)+"&val="+escape(Colleges)/>'