如果直接在javascript代碼中,顯示多行直接加/n就好了: 
復(fù)制代碼 代碼如下:
 
alert("第一行/n第二行"); 
復(fù)制代碼 代碼如下:
 
String strTemp="歷史答題報告://n"+"您答對了"+RdData.getCcnt()+"道題//n"+"您有"+RdData.getBcnt()+"道題沒答//n"+"您答錯"+RdData.getWcnt()+"題//n"; 
out.print("<script> alert('"+strTemp+"');window.location='index.jsp'</script>"); 
復(fù)制代碼 代碼如下:
 
Code Outputs 
/' single quote 
/" double quote 
// backslash 
/n new line 
/r carriage return 
/t tab 
/b backspace 
/f form feed 
新聞熱點
疑難解答
圖片精選