Recommended: Common functions for ASP: WriteLn() PrintLn() Program code % 'Function: Output string plus line break' Source: http://www.cncms.com/asp.asp Function WriteLn(sString) Response.Write( sString vbCrLf ) End Function % Program code % 'Function: Output string plus HTML code br / 'Source: http://www.cncms.com/asp.asp Function PRintLn(sString) Res
Program code
<%
'Function: Definition to output string to javascript (convention in Javascript, strings are quoted in single quotes)
'Source: 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
%>
Share: Common functions of ASP: getIMG() There are still bugs at present. The latest test page is: http://www.reallydo.com/getimg.asp The regular analysis page is: http://jorkin.reallydo.com/article.asp?id=380 If you find the bug, please leave a message later. Thank you. 1.31 Fixed src=The spaces behind cannot match correctly. Fixed. An error occurred when src='' is empty. Fixed. BUG found: There are multiple image paths.