Home > Web Front-end > JS Tutorial > body text

JavaScript method to print debugging information (Jquery)

高洛峰
Release: 2016-11-26 14:14:33
Original
1570 people have browsed it

Use alert to output information every time. The amount of information is small and debugging is inconvenient. There is such a method that can write js code better. Because Jquery is used more, I only wrote the debugging method of Jquery. You can also follow your own preferences. , add time before debugging information

/**

* Print JavaScript debugging information, use absolute positioning, and print one empty line each time

*/

function plInfo(obj){
if($("#show").length==0)
$("body").append ("

debug info
");
$("#show").append(obj+"

");
}

/**

* Print JavaScript debugging information, use absolute positioning, and the information printed each time should not be a blank line, and should be connected with --

*/

function plInfoNoBR(obj){
if($("#show").length==0)
$("body").append("

debug info
");
$("#show").append(obj + "--");
}


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template