程序代碼
<%
'功能:定義轉換為javascript字符串輸出(約定Javascript中,用單引號引用字符串)
'來源:http://www.cncms.com/asp.asp
Function Str4Js(sString)
Str4Js = sString
If IsNull(sString) Then Str4Js = "" : Exit Function
Str4Js = Replace(Str4Js, "", "")
Str4Js = Replace(Str4Js, "'", "'")
Str4Js = Replace(Str4Js, vbCrLf, "n")
Str4Js = Replace(Str4Js, vbCr, "n")
Str4Js = Replace(Str4Js, vbLf, "n")
Str4Js = Replace(Str4Js, vbTab, "t")
Str4Js = Replace(Str4Js, "script", "scr'+'ipt", 1, -1 , 1)
End Function
%>