JavaScript debugging & display variable

<! DOCTYPE HTML > 
< HTML lang = "EN" > 
< head > 
    < Meta charset = "UTF-. 8" > 
    < title > debug mode </ title > 
    ! <- debugging method is a method of displaying variables, there are three:

        alert (variable)

        console.log (variable)

        document.title = variable

     -->
    <script>

    //      the window.onload = function () { 
        //      var oBody = document.getElementById ( 'the body1'); 
        //      iNum02 = 123; 
        //      alert (iNum02); 
        //      // alert by testing, the program will then blocked code.   
        //      oBody.style.backgroundColor = 'Violet'; 
        // }
        
        the knob =  0 ;

        setInterval(function(){

            console.log (iNum ++ );
             // use console.log debugging js, you need to use console.log elements (elements) package to be tested and then view the console by console in your browser. 

            document.title = iNum;
             // use document.title test 
            // the syntax is: document.title = element; 
            // will change the position of elements displayed in the label name browser.


        },10);


    </script>
</head>
<body id="body1">
    
</body>
</html>

 

Guess you like

Origin www.cnblogs.com/jrri/p/11347455.html