熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> .NET編程 >> 正文

ASP常用函數:Str4Js()

2022-06-13   來源: .NET編程 

  程序代碼

  <%
功能:定義轉換為javascript字符串輸出(約定Javascript中用單引號引用字符串)

  Function StrJs(sString)
  StrJs = sString
  If IsNull(sString) Then StrJs = "" : Exit Function
  StrJs = Replace(StrJs "" "")
  StrJs = Replace(StrJs "" "")
  StrJs = Replace(StrJs vbCrLf "n")
  StrJs = Replace(StrJs vbCr "n")
  StrJs = Replace(StrJs vbLf "n")
  StrJs = Replace(StrJs vbTab "t")
  StrJs = Replace(StrJs "script" "scr+ipt" )
End Function
%>


From:http://tw.wingwit.com/Article/program/net/201311/14356.html
  • 上一篇文章:

  • 下一篇文章:
  • 推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.