Click here to Skip to main content
15,886,199 members
Articles / Web Development / HTML

Beginner Guide to Page and Script Debugging with Chrome

Rate me:
Please Sign up or sign in to vote.
4.95/5 (81 votes)
27 Nov 2011CPOL18 min read 1.3M   1.4K   129  
A beginner introduction to the features of the Chrome Debugger
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Chrome Debugging Example 1</title>
    <script type="text/javascript" src="js/jquery-1.6.4.min.js"></script>
    <script type="text/javascript">

        var autoupdate = true;
        var updateInterval = 1000;

        //Function contains deliberate mistake to demonstrate error in console
        function updateDateTime() 
        {
            $('#currentDateTime').html(now());
            if (autoupdate)
            {
                setTimeout(function () { updateDateTime() }, updateInterval);
            }
        }

        function updateDateTime2() {
            var currentdate = Date.toString();
            $('#currentDateTime2').html(Date().toString());
            if (autoupdate) {
                setTimeout(function () { updateDateTime2() }, updateInterval);
            }
        }
    </script>
</head>
<body>
<h2>Test Page - Example 1</h2>
<hr />
<h3>Auto Date/Time Refresh: Code 1</h3>
Current Date/Time is: <div id="currentDateTime"><script type="text/javascript">updateDateTime();</script></div>
<hr />
<h3>Auto Date/Time Refresh: Code 2</h3>
Current Date/Time is: <div id="currentDateTime2"><script type="text/javascript">updateDateTime2();</script></div>
<hr />
</body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Engineer
Scotland Scotland
I have been working in the Oil & Gas Industry for over 30 years now.

Core Discipline is Instrumentation and Control Systems.

Completed Bsc Honours Degree (B29 in Computing) with the Open University in 2012.

Currently, Offshore Installation Manager in the Al Shaheen oil field, which is located off the coast of Qatar. Prior to this, 25 years of North Sea Oil & Gas experience.

Comments and Discussions