JS also has the console object, in the console printing and debugging is good but

Source: Internet
Author: User

Console.warn ("Nothing selected, can ' t validate, returning nothing");

Run alone, incredibly printed out in the console nothing selected, can ' t validate, returning nothing,

Enlightened, since this can be printed in the console of the message, then save the trouble to use what alert or press F10 to go through the debugging, it is certain that it can be saved a lot of time.

Specifically, using the for (var i-in console) to view the console support for the various browser consoles, as follows


IE Control console
Log info warn errorassert dir Clear profile Profileend

Firebug Console
Log info warn errorDebug Exception assert dir dirxml trace Group GroupEnd groupcollapsed time Timeend profile Profileend C Ount Clear Table Notifyfirebug firebug

Chrom Console
Profiles Memory DebugError Info log warndir dirxml Trace assert count Marktimeline profile profileend time Timeend group groupcollapsed GroupEnd

Opera Console

Time Timeend Trace profile profileend Debug log info warn error assert dir dirxml group Groupcollaps Ed GroupEnd Count Table

Can be seen, four kinds of browser to log, info, warn, error Four basic methods are supported, in addition to IE, the other three also support a debug, so use Debug to pay attention to, of course, usually print debugging what, with log on the line. There is a problem, IE6/7 no developer tools, there is no console, and FF itself is not with the console, need to load the Firebug plug-in and start it, to the console, or JS error.



JS also has the console object, in the console printing and debugging is good but

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.