这个console.trace()方法用于显示跟踪, 该跟踪表示代码在特定点如何结束。
语法如下:
console.trace( label ) 
 
 
参数:此方法接受单个参数标签。
例子:
<!DOCTYPE html>
< html >
     < head >
         < title >console.trace() Method</ title >
         < style >
             h1 {
                 color:green;
             }
             body {
                 text-align:center;
             }
         </ style >
     </ head >
     < body >
         < h1 >lsbin</ h1 >
         < h2 >console.trace() Method</ h2 >
         < p >Press F12 to view the result</ p >
         < button onclick = "Function()" >Start Trace</ button >
         < script >
             function Function() {
               OtherFunction();
             }
             function OtherFunction() {
               console.trace();
             }
         </ script >
      
     </ body >
</ html > 
 
 
输出如下:
 
支持的浏览器:支持的浏览器console.trace()方法如下:
- 铬
 - Internet Explorer 11.0
 - Firefox 10.0
 - 歌剧
 - Safari 4.0
 

