[asp| HTML single and double quotes

Source: Internet
Author: User
Tags reference
May contact the website and the programming design person all knows, one attribute value needs the quotation mark to include, but sometimes is because did not set the quotation mark type correctly, causes the program to be wrong, even I myself is also this, I oneself ask oneself: Clearly writes is right, how is wrong? It turns out that after you set the quotation mark type, you can't have the same quotes in the quotation mark type, otherwise you'll make the program go wrong! So let me introduce some of the possible mistakes here!

Error-prone places in javascript:

① Error:
Reference:
<a href= "Javascript:window.open (" http://51js.com ")" > Worry-free script </a>

② correct:
Reference:
<a href= "Javascript:window.open (' http://51js.com ')" > Worry-free script </a>

Description: We can see that, in this instance, the attribute is set in double quotes, and the double quotes contained in the ① are naturally wrong! In the ② to look at the original wrong double quotes changed to single quotes, hehe! We can do it now.

Error-prone areas in ASP (VBScript):

① Error:
Reference:
<%
Response.Write ("<a href=" Javascript:window.open ("http://51js.com") "> Worry-free script </a>")
%>

② correct:
Reference:
<%
Response.Write ("<a href=" "Javascript:window.open (' http://51js.com ')" "> Worry-free script </a>")
%>
Or
<%
Response.Write ("<a href=" Javascript:window.open ("http://51js.com") ' > Worry-free script </a> ')
%>

Description: In my experience, double quotes in ASP (VBScript) must be replaced with 2 double quotes or single quotes, otherwise the program will not function properly.

Related Article

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.