Breaking javascript/html comments

Source: Internet
Author: User

Author: @ Sogili

This is just a simple note. If you have more ideas, please submit them.

1. Javascript

IE:

<Script>/* @ cc_on! Alert (1) // */</script> uses the Conditional compilation mechanism of IE to break through. about @ cc_on statment is generally used for hack.

Chrome:

<Script>/* pig/alert (3) // */</script> as you can see, this is a bug caused by a small hack when the v8 engine parses the annotation, and I don't know why it remains here.

Any:

<Script> // alert (1) </script> This is an interesting tip. You may be more clear about this:/regex // alert (1)

2. HTML

the element cannot be nested.

<! -- [If This is an ie parsing condition annotation bug, which has been abandoned in ie10. this is also a description of the weak child.

Chrome and Firefox support.

IE and Opera support.

Sleep, bye.

Published 08/14/2011

@ 0 xsec

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.