Missing <meta charset= "Utf-8"/>-raised error

Source: Internet
Author: User

Phenomenon:

Today, I found a good online feedback library for data type validation: "Validator.js", want to test the effect of HTML testing, then wrote the following code:

<HTML><Head><Scripttype= "Text/javascript"src= "Https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></Script><Scripttype= "Text/javascript"src= "Validator.min.js"></Script></Head><Body><Scripttype= "Text/javascript">Window.alert (Validator.isemail ('[email protected]')); //= True</Script><Divstyle= "height:500px; background-color:gray;">    <Divstyle= "position:relative; top:50%;left:50%; Transform:translatey ( -50%) TranslateX ( -50%); background-color:blue; width:200px; height:100px; ">    </Div></Div></Body></HTML>

After the operation, error messages are as follows:

inch character class at    validator.min.js:@    validator.min.js:    Validator.min.js:testdivmiddle.html: uncaught referenceerror:validator is no defined at    Testdivmiddle.html:10

Workaround:

Because the bosom is a character set problem, add a line of code like this:

    <meta charset= "Utf-8"/>

The result is running normally.

The full code is as follows:

<HTML><Head><MetaCharSet= "Utf-8" /><Scripttype= "Text/javascript"src= "Https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></Script><Scripttype= "Text/javascript"src= "Validator.min.js"></Script></Head><Body><Scripttype= "Text/javascript">Window.alert (Validator.isemail ('[email protected]')); //= True</Script><Divstyle= "height:500px; background-color:gray;">    <Divstyle= "position:relative; top:50%;left:50%; Transform:translatey ( -50%) TranslateX ( -50%); background-color:blue; width:200px; height:100px; ">    </Div></Div></Body></HTML>

Missing <meta charset= "Utf-8"/>-raised error

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.