ASP | HTML] single quotes and double quotes

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.