问问各位大神,在下发现了个很神奇的问题,就是当我在js alert中想要弹框中显示某些内容的时候,发现js失灵了,我本以为难道这个alert有字数限制的吗,可是当我写另外一句更长的下去时,发现弹框又可以成功了,就是本来那句不行。Response.Write("<script language=\"javascript\">alert('Sorry,you can't edit this questionnaire since you have published it')</script>");不成功
Response.Write("<script language=\"javascript\">alert('Please publish the questionnaire first and then you can send codes daosd ad asdjoa doaj sdadjaodjaosdja odoo')</script>");成功哪位大神有遇到过同样的问题呢,求解答啊!

解决方案 »

  1.   

    alert('Sorry,you can't edit this questionnaire since you have published it')</script>");can't的单引号冲突
      

  2.   

    Response.Write("<script language=\"javascript\">alert('Sorry,you can't edit this questionnaire since you have published it')</script>");不成功
    你中间出现半角的单引号了   改成全角的单引号就没问题
      

  3.   

    Response.Write("<script language=\"javascript\">alert('Sorry,you can\'t edit this questionnaire since you have published it')</script>");