<script>str="<script"+">cc='bbb';</"+"script>";
document.write(str);</script>

解决方案 »

  1.   

    我的要求是要輸出一個函數到 <script></script> 中!!!請大家幫忙!!!function outoperation()
    {
    strop="";
    strop=strop+"<SCRIPT LANGUAGE=\"JavaScript\">";
    strop=strop+"function document.onmousedown(){";
    strop=strop+"var obj=event.srcElement;var pobj=obj.parentElement.id;";
    strop=strop+"if(obj.className==\"span\"){for(i=0;i<4;i++){if(pobj==(\"btn\"+i)){document.all(\"m\"+i).style.backgroundColor=\"menu\"document.all(\"btn\"+i).style.height=20;document.all(\"tb\"+i).style.display='';}else{document.all(\"m\"+i).style.backgroundColor=\"white\"document.all(\"btn\"+i).style.height=18;document.all(\"tb\"+i).style.display='none';}}}"; strop=strop+"}"; strop=strop+"</SCRIPT>"; document.write(strop);}
      

  2.   

    把"</SCRIPT>"如 fason(阿信) 仁兄般拆成 "</" +"SCRIPT>"即可,因为</SCRIPT>特殊的javascript标签。
      

  3.   

    "</script>"改成"<\/script>"就行了!<script>str="<script>cc=\"bbb\";<\/script>";
    document.write(str);</script>