Console of the developer tool "HTML5 and CSS3 Basics"

Source: Internet
Author: User

Today's browsers often have a developer tool to help developers build more efficient websites.

The developer tool has a console window (console window) for outputting some debugging information, and with this tool you can finally say goodbye to debugging JavaScript with alert. And the console's function is much more than just outputting a little bit of information about where it is now, it can also identify different kinds of information and provide hyperlinks to the corresponding code.

The developer tool uses this object to output work information from inside the application to the console console by loading an object named console into the global namespace. The following is a method of the 7 console objects, which are described in the comments:

<! DOCTYPE html><html>  <head>    <meta content="text/html; CHARSET=GBK " http-equiv=" Content-type ">    <title>Console.log</title>  </head>  <body>    <script>Console.log ("Test-log");    //Output a message to the console console.debug ("Test-debug");      //output information, and there will be a hyperlink linked to code console.info ("Test-info");      //Output a message icon and information Console.warn ("Test-warn");    //Output a warning icon and warning message console.error ("Test-error");            //output an incorrect icon and error message Console.assert (3<2); //Assertion errors are displayed on the console and are not displayed correctly              //console.clear (); Clear the console information           </script>  </body></html>

Console of the developer tool "HTML5 and CSS3 Basics"

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.