Javascript使用document.write(str)進(jìn)行輸出時,常提示下列錯誤:Error: unterminated string literal。
通常原因是輸出字符str中包含換行符導(dǎo)致的。
解決方法如下:
asp:
str=replace(str,vbcrlf,"",1,-1,1)
php:
$str = str_replace("\n", "", $str);
$str = str_replace("\r", "", $str);
然后再進(jìn)行document.write(str)輸出。
本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請
點(diǎn)擊舉報。