<Script type = "text/javascript">
Function Display (LoginEmail, UserName, ID ){
Alert (LoginEmail );
}
</Script>
1. Passing parameters using single quotes:
<A href = "javascript: Display ('abc @ abc.com ', 'aleax xie', '000000')"> Test1 </a>
If one of the parameters contains single quotes, this method will fail.
<A href = "javascript: Display ('abc @ a' bc. com ', 'aleax xie', '000000')"> Test1 </a>
Improvement: \ 'and OK are added with single quotes.
<A href = "javascript: Display ('abc @ a \ 'bc. com', 'aleax xie', '000000')"> Test </a>
2. The problem of single quotes is solved above, but if there is a problem with double quotes in the value
<A href = "javascript: Display ('abc @ a \ 'bc". com ', 'aleax xie', '000000') "> Test </a>
Improvement: Onclick is used, and \ "is added to double quotation marks. You do not need to process single quotation marks, and" or "is not added to JS methods.
<A href = "javascript: void (0)" onclick = Display ("abc @ \" AB 'C. com "," Aleax Xie "," 10101239393 ")> Test3 </a>
This solves the single quotation marks and double quotation marks in Js parameters. However, there are restrictions: there must be no spaces between parameters and parameters, and no spaces in parameter values. If there is a space, it is replaced.