ASP | HTML] single quotes and double quotes
People who may be familiar with website and programming design know that a property value must be enclosed in quotation marks, but sometimes it is because the type of quotation marks is not set correctly, which leads to program errors, even by myself, I asked myself: what is clearly correct? Why is it wrong? It turns out that the quotation mark type cannot appear in the same quotation mark type after it is set; otherwise, the program will fail! Let me introduce several possible errors here!
Errors in JAVASCRIPT:
① Error:
QUOTE:
<A href = "javascript: window. open (" http: // ")"> carefree script </a>
② Correct:
QUOTE:
<A href = "javascript: window. open ('http: // ')"> carefree script </a>
Note: You can see that in this example, the attribute is set with double quotation marks, and the double quotation marks contained in ① are naturally wrong! Change the incorrect double quotation marks to single quotation marks in View ②! Now.
Errors in ASP (vbscript:
① Error:
QUOTE:
<%
Response. write ("<a href =" javascript: window. open ("http: //") "> carefree script </a> ")
%>
② Correct:
QUOTE:
<%
Response. write ("<a href =" "javascript: window. open ('http: // ')" "> carefree script </a> ")
%>
Or
<%
Response. write ("<a href = 'javascript: window. open (" http: // "") '> carefree script </a> ")
%>
Note: According to my experience, the double quotation marks in ASP (vbscript) must be replaced by two double quotation marks or single quotation marks. Otherwise, the program will not run normally.