Sudoku in HTML5

Developing a Sudoku Game in HTML5

 
Sudoku is a number puzzle game that is very popular right now. The puzzle is a 9x9 grid, divided into nine 3x3 boxes, each of which is comprised of 9 cells. The following figure shows the total grid of 81 cells.
 
sudo1.jpg

The goal of the puzzle

 
The goal is to fill every cell with a number, 1 through 9, such that each row, column, and box contains only one instance of each number from 1 through 9.
 
sudo3.jpg
 
The initial state of each puzzle consists of some cells in the grid already populated with numbers. Given this initial state, there is one, and only one, the solution to the puzzle, and it can be deduced using logic to fill in all of the missing numbers.
 
Consider the puzzle in the figure. As mentioned, every box must include the numbers 1 through 9. Currently, the upper-left box doesn't have a 2 in it, but I can figure out where the 2 in that box should go through simple deduction. I know it can't be in the top row because there's already a 2 in that row (the 2 in the upper-right corner, highlighted in yellow). I know it can't be in the middle row, because there's already a 2 there, as well (the 2 in the second row, fourth column). It obviously can't be in the third row, the second column, as there's already a 7 there (highlighted in yellow), and it can't be in the cell to the 7's right, because there's already a 2 in that column (highlighted in yellow in the eighth row). Therefore, the 2 must be in the third row, the first column—the cell highlighted in red. I can fill in that 2, moving me one step closer to solving the puzzle.
 
sudoku.jpg
Rules of the Puzzle
  1. No number can repeat itself in the same 3x3 square
  2. No number can repeat itself on the same 9 cells column or row.
  3. Every empty cell should have a "mirror" empty cell (for example cells [0,7] & [8,1] or [3,3] & [5,5]). Also when cells and 3x3 Cox index starts from "0", left to right, top to bottom.
  4. Each game should have one and only one solution to be considered a valid Sudoku game.
Game Options
 
1. Game
  • New: The user can select among multiple difficulty levels:
             1. Easy              2. Medium              3. Hard
  • Save/Restore: The user can save the game.
2. Edit
  • Undo: Undoes the last digit entered or other user actions such as Accept or Solve. It is implemented using a stack so records can undo an unlimited number of actions. A Load, Reset or Clear empties the undo stack.
  • Hint: Enters the answer to the current cell in that cell. It gets the answer from the current board hence if the board is already incorrect, no hint will be given.
  • Restart: Play the same game from a state before any move was first made.
  • Solve: Solves the entire problem from the current position. This may not give the solution if values already entered are incorrect.  
3. Sound
  • On: The user can hear the sound while solving the Sudoku.
  • Off: The user solves the Sudoku in silent mode.
4. Keyboard
  • On: The user can solve the Sudoku using the keyboard.
  • Off: The user solves the Sudoku without any use of the keyboard.
5. Help
  • Rules:
  1. No number can repeat itself in the same 3x3 square.
  2. No number can repeat itself on the same 9 cells column or row.
  3. Every empty cell should have a "mirror" empty cell (for example cells [0,7] & [8,1] or [3,3] & [5,5]) Also when cells and 3x3 Cox index starts from "0", left to right, top to bottom.
  4. Each game should have one and only solution to be considered a valid Sudoku game.
  • About: The puzzle was introduced in Japan by Nikoli in the paper Monthly Nikolist in April 1984 as "SÅ«ji wa dokushin ni kagiru", which can be translated as "the digits must be single" or "the digits are limited to one occurrence". (In Japanese, dokushin means an "unmarried person".) At a later date, the name was abbreviated to Sudoku by Maki Kaji, taking only the first Kanji of compound words to form a shorter version. Sudoku is a registered trademark in Japan and the puzzle is generally referred to as Number Place. In 1986, Nikoli introduced two innovations: the number of givens was restricted to no more than 32, and puzzles became "symmetrical".
Example
  1. <!doctype html>  
  2. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">  
  3. <head>  
  4.     <meta charset="utf-8" />  
  5.     <meta http-equiv="X-UA-Compatible" content="chrome=1">  
  6.     <title>Sudoku Preview - CodeCanyon</title>  
  7.     <meta name="Description" content="Sudoku is a logic-based, combinatorial puzzle. The objective is to fill a 9×9 grid with digits so...">  
  8.     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
  9.     <link href="http://1.envato-static.com/assets/fullscreen_preview-2dff58760ddd3fb5acb3540e65f6ef43.css" media="screen" rel="stylesheet" type="text/css" />  
  10.     <link rel="apple-touch-icon-precomposed" sizes="144x144" href="/icons/codecanyon.net/apple-touch-icon-144x144-precomposed.png" />  
  11.     <link rel="apple-touch-icon-precomposed" sizes="114x114" href="/icons/codecanyon.net/apple-touch-icon-114x114-precomposed.png" />  
  12.     <link rel="apple-touch-icon-precomposed" sizes="72x72" href="/icons/codecanyon.net/apple-touch-icon-72x72-precomposed.png" />  
  13.     <link rel="apple-touch-icon-precomposed" href="/icons/codecanyon.net/apple-touch-icon-precomposed.png" />  
  14.     <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>  
  15.     <script>window.jQuery || document.write("<script src='http://3.envato-static.com/assets/lib/jquery-1.8.1.min-da0866090343e2cef3f789ab7482744a.js'><\/script>")</script>  
  16.     <script>  
  17.         //function to fix height of iframe!  
  18.         var calcHeight = function () {  
  19.             var headerDimensions = $('#header-bar').height();  
  20.             $('#preview-frame').height($(window).height() - headerDimensions);  
  21.         }  
  22.         $(document).ready(function () {  
  23.             calcHeight();  
  24.             $('#header-bar a.close').mouseover(function () {  
  25.                 $('#header-bar a.close').addClass('activated');  
  26.             }).mouseout(function () {  
  27.                 $('#header-bar a.close').removeClass('activated');  
  28.             });  
  29.         });  
  30.         $(window).resize(function () {  
  31.             calcHeight();  
  32.         }).load(function () {  
  33.             calcHeight();  
  34.         });  
  35.     </script>  
  36.     <!-- JAVASCRIPT FOR AND GOOGLE ANALYTICS -->  
  37.     <script>  
  38.         var _gaq = _gaq || [];  
  39.         _gaq.push(['_setAccount''UA-11834194-12']);  
  40.         _gaq.push(['_trackPageLoadTime']);  
  41.         _gaq.push(['_trackPageview']);  
  42.         _gaq.push(['b._setAccount''UA-11834194-36']);  
  43.         _gaq.push(['b._trackPageLoadTime']);  
  44.         _gaq.push(['b._trackPageview']);  
  45.         (function () {  
  46.             var ga = document.createElement('script');  
  47.             ga.async = true;  
  48.             ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';  
  49.             ga.setAttribute('async''true');  
  50.             var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);  
  51.         })();  
  52.     </script> <!doctype html>  
  53. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">  
  54. <head>  
  55.     <meta charset="utf-8" />  
  56.     <meta http-equiv="X-UA-Compatible" content="chrome=1">  
  57.     <title>Sudoku Preview - CodeCanyon</title>  
  58.     <meta name="Description" content="Sudoku is a logic-based, combinatorial puzzle. The objective is to fill a 9×9 grid with digits so...<!doctype html>  
  59. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">  
  60. <head>  
  61.     <meta charset="utf-8" />  
  62.     <meta http-equiv="X-UA-Compatible" content="chrome=1">  
  63.     <title>Sudoku Preview - CodeCanyon</title>  
  64.     <meta name="Description" content="Sudoku is a logic-based, combinatorial puzzle. The objective is to fill a 9×9 grid with digits so...">  
  65.     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
  66.     <link href="http://1.envato-static.com/assets/fullscreen_preview-2dff58760ddd3fb5acb3540e65f6ef43.css" media="screen" rel="stylesheet" type="text/css" />  
  67.     <link rel="apple-touch-icon-precomposed" sizes="144x144" href="/icons/codecanyon.net/apple-touch-icon-144x144-precomposed.png" />  
  68.     <link rel="apple-touch-icon-precomposed" sizes="114x114" href="/icons/codecanyon.net/apple-touch-icon-114x114-precomposed.png" />  
  69.     <link rel="apple-touch-icon-precomposed" sizes="72x72" href="/icons/codecanyon.net/apple-touch-icon-72x72-precomposed.png" />  
  70.     <link rel="apple-touch-icon-precomposed" href="/icons/codecanyon.net/apple-touch-icon-precomposed.png" />  
  71.     <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>  
  72.     <script>window.jQuery || document.write("<script src='http://3.envato-static.com/assets/lib/jquery-1.8.1.min-da0866090343e2cef3f789ab7482744a.js'><\/script>")</script>  
  73.     <script>  
  74.         //function to fix height of iframe!  
  75.         var calcHeight = function () {  
  76.             var headerDimensions = $('#header-bar').height();  
  77.             $('#preview-frame').height($(window).height() - headerDimensions);  
  78.         }  
  79.         $(document).ready(function () {  
  80.             calcHeight();  
  81.             $('#header-bar a.close').mouseover(function () {  
  82. <!doctype html>  
  83. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">  
  84. <head>  
  85.     <meta charset="utf-8" />  
  86.     <meta http-equiv="X-UA-Compatible" content="chrome=1">  
  87.     <title>Sudoku Preview - CodeCanyon</title>  
  88.     <meta name="Description" content="Sudoku is a logic-based, combinatorial puzzle. The objective is to fill a 9×9 grid with digits so...">  
  89.     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
  90.     <link href="http://1.envato-static.com/assets/fullscreen_preview-2dff58760ddd3fb5acb3540e65f6ef43.css" media="screen" rel="stylesheet" type="text/css" />  
  91.     <link rel="apple-touch-icon-precomposed" sizes="144x144" href="/icons/codecanyon.net/apple-touch-icon-144x144-precomposed.png" />  
  92.     <link rel="apple-touch-icon-precomposed" sizes="114x114" href="/icons/codecanyon.net/apple-touch-icon-114x114-precomposed.png" />  
  93.     <link rel="apple-touch-icon-precomposed" sizes="72x72" href="/icons/codecanyon.net/apple-touch-icon-72x72-precomposed.png" />  
  94.     <link rel="apple-touch-icon-precomposed" href="/icons/codecanyon.net/apple-touch-icon-precomposed.png" />  
  95.     <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>  
  96.     <script>window.jQuery || document.write("<script src='http://3.envato-static.com/assets/lib/jquery-1.8.1.min-da0866090343e2cef3f789ab7482744a.js'><\/script>")</script>  
  97.     <script>  
  98.         //function to fix height of iframe!  
  99.         var calcHeight = function () {  
  100.             var headerDimensions = $('#header-bar').height();  
  101.             $('#preview-frame').height($(window).height() - headerDimensions);  
  102.         }  
  103.         $(document).ready(function () {  
  104.             calcHeight();  
  105.             $('#header-bar a.close').mouseover(function () {  
  106.                 $('#header-bar a.close').addClass('activated');  
  107.             }).mouseout(function () {  
  108.                 $('#header-bar a.close').removeClass('activated');  
  109.             });  
  110.         });  
  111.         $(window).resize(function () {  
  112.             calcHeight();  
  113.         }).load(function () {  
  114.             calcHeight();  
  115.         });  
  116.     </script>  
  117.     <!-- JAVASCRIPT FOR AND GOOGLE ANALYTICS -->  
  118.     <script>  
  119.         var _gaq = _gaq || [];  
  120.         _gaq.push(['_setAccount''UA-11834194-12']);  
  121.         _gaq.push(['_trackPageLoadTime']);  
  122.         _gaq.push(['_trackPageview']);  
  123.         _gaq.push(['b._setAccount''UA-11834194-36']);  
  124.         _gaq.push(['b._trackPageLoadTime']);  
  125.         _gaq.push(['b._trackPageview']);  
  126.         (function () {  
  127.             var ga = document.createElement('script');  
  128.             ga.async = true;  
  129.             ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';  
  130.             ga.setAttribute('async''true');  
  131.             var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);  
  132.         })();  
  133.     </script>   
  134.     <!-- END JAVASCRIPT -->  
  135.     <meta content="" name="WT.si_n" />  
  136.     <meta content="" name="WT.si_x" />  
  137.     <meta content="" name="WT.si_cs" />  
  138.     <script type="text/javascript">var NREUMQ = NREUMQ || []; NREUMQ.push(["mark""firstbyte"new Date().getTime()]);</script>  
  139. </head>  
  140. <body>  
  141.     <div id="header-bar">  
  142.         <div class="close-header">  
  143.             <a id="close-button" title="Close CodeCanyon Bar" class="close" href="http://codeblog.cz/sudoku/">X</a>  
  144.         </div>  
  145.         <p class="meta-data">  
  146.             <a class="close" href="http://codeblog.cz/sudoku/">Remove Frame</a> <a class="purchase" href="/item/sudoku/3576054">Purchase this Item!</a>  
  147.         </p>  
  148.         <a class="acodecanyon-preview-logo site-loopback" href="/item/sudoku/3576054">codecanyon</a><span class="preview">item preview</span>   
  149.     </div>  
  150.     <iframe id="preview-frame" src="http://codeblog.cz/sudoku/" name="preview-frame" frameborder="0" noresize="noresize"></iframe>  
  151.     <!-- START OF SmartSource Data Collector TAG v10.2.0 -->  
  152.     <!-- Copyright (c) 2012 Webtrends Inc.  All rights reserved. -->  
  153.     <script>  
  154.         window.webtrendsAsyncInit = function () {  
  155.             var dcs = new Webtrends.dcs().init({  
  156.                 dcsid: "dcsu1to8wvz5bd8f6if7d3qse_2j4x"  
  157.                 , domain: "statse.webtrendslive.com"  
  158.                 , timezone: 10  
  159.                 , offsite: true  
  160.                 , download: true  
  161.                 , downloadtypes: "xls,doc,pdf,txt,csv,zip,docx,xlsx,rar,gzip"  
  162.                 , onsitedoms: "codecanyon.net"  
  163.                 , plugins: {  
  164.                     hm: { src: "//s.webtrends.com/js/webtrends.hm.js" }  
  165.                 }  
  166.             }).track();  
  167.         };  
  168.         marketplace.load("http://0.envato-static.com/assets/webtrends.min-5a2a0b3d9f0eeafea3f60e4831cf4958.js");  
  169.     </script>  
  170.     <noscript><img alt="dcsimg" id="dcsimg" width="1" height="1" src="//statse.webtrendslive.com/dcs4nx9hnvz5bd4wo8cwvxpse_5g4u/njs.gif?dcsuri=/nojavascript&WT.js=No&WT.tv=10.2.0&dcssip=www.3docean.net"/></noscript>  
  171.     <!-- END OF SmartSource Data Collector TAG v10.2.0 -->  
  172.     <!--[if lt IE 7]>  
  173.    <script src="http://3.envato-static.com/assets/lib/DD_belatedPNG-27285c137194823d2b38f405dd132024.js" type="text/javascript"></script>  
  174.    <script src="http://2.envato-static.com/assets/utilities/ie6-bf43a1fe705b18ce14da6c1e3ab8f752.js" type="text/javascript"></script>  
  175.   <![endif]-->  
  176.     <script type="text/javascript">if (!NREUMQ.f) {  
  177.     NREUMQ.f = function () {  
  178.         NREUMQ.push(["load"new Date().getTime()]);  
  179.         var e = document.createElement("script");  
  180.         e.type = "text/javascript";  
  181.         e.src = (("http:" === document.location.protocol) ? "http:" : "https:") + "//" +  
  182.           "d1ros97qkrwjf5.cloudfront.net/42/eum/rum.js";  
  183.         document.body.appendChild(e);  
  184.         if (NREUMQ.a) NREUMQ.a();  
  185.     };  
  186.     NREUMQ.a = window.onload; window.onload = NREUMQ.f;  
  187. };  
  188.         NREUMQ.push(["nrfj""beacon-1.newrelic.com""fcf8d519de""13909,1601845,716468""dA4NFkNbVV1URBcMRVIMTAREWFVuQlVKAFRZPhMQVEJQVEY=", 5, 37, new Date().getTime(), """"""""""]);</script>  
  189. </body>  
  190. </html>  
  191.                 $('#header-bar a.close').addClass('activated');  
  192.             }).mouseout(function () {  
  193.                 $('#header-bar a.close').removeClass('activated');  
  194.             });  
  195.         });  
  196.         $(window).resize(function () {  
  197.             calcHeight();  
  198.         }).load(function () {  
  199.             calcHeight();  
  200.         });  
  201.     </script>  
  202.   
  203.     <!-- JAVASCRIPT FOR AND GOOGLE ANALYTICS -->  
  204.     <script>  
  205.         var _gaq = _gaq || [];  
  206.         _gaq.push(['_setAccount''UA-11834194-12']);  
  207.         _gaq.push(['_trackPageLoadTime']);  
  208.         _gaq.push(['_trackPageview']);  
  209.         _gaq.push(['b._setAccount''UA-11834194-36']);  
  210.         _gaq.push(['b._trackPageLoadTime']);  
  211.         _gaq.push(['b._trackPageview']);  
  212.         (function () {  
  213.             var ga = document.createElement('script');  
  214.             ga.async = true;  
  215.             ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';  
  216.             ga.setAttribute('async''true');  
  217.             var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);  
  218.         })();  
  219.     </script>   
  220.     <!-- END JAVASCRIPT -->  
  221.     <meta content="" name="WT.si_n" />  
  222.     <meta content="" name="WT.si_x" />  
  223.     <meta content="" name="WT.si_cs" />  
  224.     <script type="text/javascript">var NREUMQ = NREUMQ || []; NREUMQ.push(["mark""firstbyte"new Date().getTime()]);</script>  
  225. </head>  
  226. <body>  <h2>
    </h2>
  227.     <div id="header-bar">  
  228.         <div class="close-header">  
  229.             <a id="close-button" title="Close CodeCanyon Bar" class="close" href="http://codeblog.cz/sudoku/">X</a>  
  230.         </div>  
  231.         <p class="meta-data">  
  232.             <a class="close" href="http://codeblog.cz/sudoku/">Remove Frame</a> <a class="purchase" href="/item/sudoku/3576054">Purchase this Item!</a>  
  233.         </p>  
  234.         <a class="acodecanyon-preview-logo site-loopback" href="/item/sudoku/3576054">codecanyon</a><span class="preview">item preview</span>   
  235.     </div>  
  236.     <iframe id="preview-frame" src="http://codeblog.cz/sudoku/" name="preview-frame" frameborder="0" noresize="noresize"></iframe>  
  237.     <!-- START OF SmartSource Data Collector TAG v10.2.0 -->  
  238.     <!-- Copyright (c) 2012 Webtrends Inc.  All rights reserved. -->  
  239.     <script>  
  240.         window.webtrendsAsyncInit = function () {  
  241.             var dcs = new Webtrends.dcs().init({  
  242.                 dcsid: "dcsu1to8wvz5bd8f6if7d3qse_2j4x"  
  243.                 , domain: "statse.webtrendslive.com"  
  244.                 , timezone: 10  
  245.                 , offsite: true  
  246.                 , download: true  
  247.                 , downloadtypes: "xls,doc,pdf,txt,csv,zip,docx,xlsx,rar,gzip"  
  248.                 , onsitedoms: "codecanyon.net"  
  249.                 , plugins: {  
  250.                     hm: { src: "//s.webtrends.com/js/webtrends.hm.js" }<h2>
    </h2> 
  251.                 }  
  252.             }).track();  
  253.         };  
  254.         marketplace.load("http://0.envato-static.com/assets/webtrends.min-5a2a0b3d9f0eeafea3f60e4831cf4958.js");  
  255.     </script>  
  256.     <noscript><img alt="dcsimg" id="dcsimg" width="1" height="1" src="//statse.webtrendslive.com/dcs4nx9hnvz5bd4wo8cwvxpse_5g4u/njs.gif?dcsuri=/nojavascript&WT.js=No&WT.tv=10.2.0&dcssip=www.3docean.net"/></noscript>  
  257.     <!-- END OF SmartSource Data Collector TAG v10.2.0 -->  
  258.     <!--[if lt IE 7]>  
  259.    <script src="http://3.envato-static.com/assets/lib/DD_belatedPNG-27285c137194823d2b38f405dd132024.js" type="text/javascript"></script>  
  260.    <script src="http://2.envato-static.com/assets/utilities/ie6-bf43a1fe705b18ce14da6c1e3ab8f752.js" type="text/javascript"></script>  
  261.   <![endif]-->  
  262.     <script type="text/javascript">if (!NREUMQ.f) {  
  263.     NREUMQ.f = function () {  
  264.         NREUMQ.push(["load"new Date().getTime()]);  
  265.         var e = document.createElement("script");  
  266.         e.type = "text/javascript";  
  267.         e.src = (("http:" === document.location.protocol) ? "http:" : "https:") + "//" +  
  268.           "d1ros97qkrwjf5.cloudfront.net/42/eum/rum.js";  
  269.         document.body.appendChild(e);  
  270.         if (NREUMQ.a) NREUMQ.a();  
  271.     };  
  272.     NREUMQ.a = window.onload; window.onload = NREUMQ.f;  
  273. };  <h2>
    </h2>
  274.         NREUMQ.push(["nrfj""beacon-1.newrelic.com""fcf8d519de""13909,1601845,716468""dA4NFkNbVV1URBcMRVIMTAREWFVuQlVKAFRZPhMQVEJQVEY=", 5, 37, new Date().getTime(), """"""""""]);</script>  
  275. </body>  
  276. </html>">  
  277.     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
  278.     <link href="http://1.envato-static.com/assets/fullscreen_preview-2dff58760ddd3fb5acb3540e65f6ef43.css" media="screen" rel="stylesheet" type="text/css" />  
  279.     <link rel="apple-touch-icon-precomposed" sizes="144x144" href="/icons/codecanyon.net/apple-touch-icon-144x144-precomposed.png" />  
  280.     <link rel="apple-touch-icon-precomposed" sizes="114x114" href="/icons/codecanyon.net/apple-touch-icon-114x114-precomposed.png" />  
  281.     <link rel="apple-touch-icon-precomposed" sizes="72x72" href="/icons/codecanyon.net/apple-touch-icon-72x72-precomposed.png" />  
  282.     <link rel="apple-touch-icon-precomposed" href="/icons/codecanyon.net/apple-touch-icon-precomposed.png" />  
  283.     <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>  
  284.     <script>window.jQuery || document.write("<script src='http://3.envato-static.com/assets/lib/jquery-1.8.1.min-da0866090343e2cef3f789ab7482744a.js'><\/script>")</script>  
  285.     <script>  
  286.         //function to fix height of iframe!  
  287.         var calcHeight = function () {  
  288.             var headerDimensions = $('#header-bar').height();  
  289.             $('#preview-frame').height($(window).height() - headerDimensions);  
  290.         }  
  291.         $(document).ready(function () {  
  292.             calcHeight();  
  293.             $('#header-bar a.close').mouseover(function () {  
  294.                 $('#header-bar a.close').addClass('activated');  
  295.             }).mouseout(function () {  <h2>
    </h2>
  296.                 $('#header-bar a.close').removeClass('activated');  
  297.             });  
  298.         });  
  299.         $(window).resize(function () {  
  300.             calcHeight();  
  301.         }).load(function () {  
  302.             calcHeight();  
  303.         });  
  304.     </script>  
  305.   
  306.     <!-- JAVASCRIPT FOR AND GOOGLE ANALYTICS -->  
  307.     <script>  
  308.         var _gaq = _gaq || [];  
  309.         _gaq.push(['_setAccount''UA-11834194-12']);  
  310.         _gaq.push(['_trackPageLoadTime']);  
  311.         _gaq.push(['_trackPageview']);  
  312.         _gaq.push(['b._setAccount''UA-11834194-36']);  
  313.         _gaq.push(['b._trackPageLoadTime']);  
  314.         _gaq.push(['b._trackPageview']);  
  315.         (function () {  
  316.             var ga = document.createElement('script');  
  317.             ga.async = true;  
  318.             ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';  
  319.             ga.setAttribute('async''true');  
  320.             var s = document.getElementsByTagName('script')[0]; s.par<h2>
    </h2>entNode.insertBefore(ga, s);  
  321.         })();  
  322.     </script>   
  323.     <!-- END JAVASCRIPT -->  
  324.     <meta content="" name="WT.si_n" />  
  325.     <meta content="" name="WT.si_x" />  
  326.     <meta content="" name="WT.si_cs" />  
  327.     <script type="text/javascript">var NREUMQ = NREUMQ || []; NREUMQ.push(["mark""firstbyte"new Date().getTime()]);</script>  
  328. </head>  
  329. <body>  
  330.     <div id="header-bar">  
  331.         <div class="close-header">  
  332.             <a id="close-button" title="Close CodeCanyon Bar" class="close" href="http://codeblog.cz/sudoku/">X</a>  
  333.         </div>  
  334.         <p class="meta-data">  
  335.             <a class="close" href="http://codeblog.cz/sudoku/">Remove Frame</a> <a class="purchase" href="/item/sudoku/3576054">Purchase this Item!</a>  
  336.         </p>  
  337.         <a class="acodecanyon-preview-logo site-loopback" href="/item/sudoku/3576054">codecanyon</a><span class="preview">item preview</span>   
  338.     </div>  
  339.     <iframe id="preview-frame" src="http://codeblog.cz/sudoku/" name="preview-frame" frameborder="0" noresize="noresize"></iframe>  
  340.     <!-- START OF SmartSource Data Collector TAG v10.2.0 -->  
  341.     <!-- Copyright (c) 2012 Webtrends Inc.  All rights reserved. -->  
  342.     <script>  
  343.         window.webtrendsAsyncInit = function () {  
  344.             var dcs = new Webtrends.dcs().init({  
  345.                 dcsid: "dcsu1to8wvz5bd8f6if7d3qse_2j4x"  
  346.                 , domain: "statse.webtrendslive.com"  
  347.                 , timezone: 10  
  348.                 , offsite: true  
  349.                 , download: true  
  350.                 , downloadtypes: "xls,doc,pdf,txt,csv,zip,docx,xlsx,rar,gzip"  
  351.                 , onsitedoms: "codecanyon.net"  
  352.                 , plugins: {  
  353.                     hm: { src: "//s.webtrends.com/js/webtrends.hm.js" }  
  354.                 }  
  355.             }).track();  
  356.         };  
  357.         marketplace.load("http://0.envato-static.com/assets/webtrends.min-5a2a0b3d9f0eeafea3f60e4831cf4958.js");  
  358.     </script>  
  359.     <noscript><img alt="dcsimg" id="dcsimg" width="1" height="1" src="//statse.webtrendslive.com/dcs4nx9hnvz5bd4wo8cwvxpse_5g4u/njs.gif?dcsuri=/nojavascript&WT.js=No&WT.tv=10.2.0&dcssip=www.3docean.net"/></noscript>  
  360.     <!-- END OF SmartSource Data Collector TAG v10.2.0 -->  
  361.     <!--[if lt IE 7]>  
  362.    <script src="http://3.envato-static.com/assets/lib/DD_belatedPNG-27285c137194823d2b38f405dd132024.js" type="text/javascript"></script>  
  363.    <script src="http://2.envato-static.com/assets/utilities/ie6-bf43a1fe705b18ce14da6c1e3ab8f752.js" type="text/javascript"></script>  
  364.   <![endif]-->  
  365.     <script type="text/javascript">if (!NREUMQ.f) {  
  366.     NREUMQ.f = function () {  
  367.         NREUMQ.push(["load"new Date().getTime()]);  
  368.         var e = document.createElement("script");  
  369.         e.type = "text/javascript";  
  370.         e.src = (("http:" === document.location.protocol) ? "http:" : "https:") + "//" +  
  371.           "d1ros97qkrwjf5.cloudfront.net/42/eum/rum.js";  
  372.         document.body.appendChild(e);  
  373.         if (NREUMQ.a) NREUMQ.a();  
  374.     };  
  375.     NREUMQ.a = window.onload; window.onload = NREUMQ.f;  
  376. };  
  377.         NREUMQ.push(["nrfj""beacon-1.newrelic.com""fcf8d519de""13909,1601845,716468""dA4NFkNbVV1URBcMRVIMTAREWFVuQlVKAFRZPhMQVEJQVEY=", 5, 37, new Date().getTime(), """"""""""]);</script>  
  378. </body>  
  379. </html>  
  380.     <!-- END JAVASCRIPT -->  
  381.     <meta content="" name="WT.si_n" />  
  382.     <meta content="" name="WT.si_x" />  
  383.     <meta content="" name="WT.si_cs" />  
  384.     <script type="text/javascript">var NREUMQ = NREUMQ || []; NREUMQ.push(["mark""firstbyte"new Date().getTime()]);</script>  
  385. </head>  
  386. <body>  
  387.     <div id="header-bar">  
  388.         <div class="close-header">  
  389.             <a id="close-button" title="Close CodeCanyon Bar" class="close" href="http://codeblog.cz/sudoku/">X</a>  
  390.         </div>  
  391.         <p class="meta-data">  
  392.             <a class="close" href="http://codeblog.cz/sudoku/">Remove Frame</a> <a class="purchase" href="/item/sudoku/3576054">Purchase this Item!</a>  
  393.         </p>  
  394.         <a class="acodecanyon-preview-logo site-loopback" href="/item/sudoku/3576054">codecanyon</a><span class="preview">item preview</span>   
  395.     </div>  
  396.     <iframe id="preview-frame" src="http://codeblog.cz/sudoku/" name="preview-frame" frameborder="0" noresize="noresize"></iframe>  
  397.     <!-- START OF SmartSource Data Collector TAG v10.2.0 -->  
  398.     <!-- Copyright (c) 2012 Webtrends Inc.  All rights reserved. -->  
  399.     <script>  
  400.         window.webtrendsAsyncInit = function () {  
  401.             var dcs = new Webtrends.dcs().init({  
  402.                 dcsid: "dcsu1to8wvz5bd8f6if7d3qse_2j4x"  <h2>
    </h2>
  403.                 , domain: "statse.webtrendslive.com"  
  404.                 , timezone: 10  
  405.                 , offsite: true  
  406.                 , download: true  
  407.                 , downloadtypes: "xls,doc,pdf,txt,csv,zip,docx,xlsx,rar,gzip"  
  408.                 , onsitedoms: "codecanyon.net"  
  409.                 , plugins: {  
  410.                     hm: { src: "//s.webtrends.com/js/webtrends.hm.js" }  
  411.                 }  
  412.             }).track();  
  413.         };  
  414.         marketplace.load("http://0.envato-static.com/assets/webtrends.min-5a2a0b3d9f0eeafea3f60e4831cf4958.js");  
  415.     </script>  
  416.     <noscript><img alt="dcsimg" id="dcsimg" width="1" height="1" src="//statse.webtrendslive.com/dcs4nx9hnvz5bd4wo8cwvxpse_5g4u/njs.gif?dcsuri=/nojavascript&WT.js=No&WT.tv=10.2.0&dcssip=www.3docean.net"/></noscript>  
  417.     <!-- END OF SmartSource Data Collector TAG v10.2.0 -->  
  418.     <!--[if lt IE 7]>  
  419.    <script src="http://3.envato-static.com/assets/lib/DD_belatedPNG-27285c137194823d2b38f405dd132024.js" type="text/javascript"></script>  
  420.    <script src="http://2.envato-static.com/assets/utilities/ie6-bf43a1fe705b18ce14da6c1e3ab8f752.js" type="text/javascript"></script>  
  421.   <![endif]-->  
  422.     <script type="text/javascript">if (!NREUMQ.f) {  
  423.     NREUMQ.f = function () {  
  424.         NREUMQ.push(["load"new Date().getTime()]);  
  425.         var e = document.createElement("script");  <h2>
    </h2>
  426.         e.type = "text/javascript";  
  427.         e.src = (("http:" === document.location.protocol) ? "http:" : "https:") + "//" +  
  428.           "d1ros97qkrwjf5.cloudfront.net/42/eum/rum.js";  
  429.         document.body.appendChild(e);  
  430.         if (NREUMQ.a) NREUMQ.a();  
  431.     };  
  432.     NREUMQ.a = window.onload; window.onload = NREUMQ.f;  
  433. };  <h2>
    </h2>
  434.         NREUMQ.push(["nrfj""beacon-1.newrelic.com""fcf8d519de""13909,1601845,716468""dA4NFkNbVV1URBcMRVIMTAREWFVuQlVKAFRZPhMQVEJQVEY=", 5, 37, new Date().getTime(), """"""""""]);</script>  
  435. </body>  
  436. </html> 
Output
sudo.jpg
 


Similar Articles