• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!DOCTYPE html>
2<!--
3 * Copyright (c) 2010 The Chromium Authors. All rights reserved.  Use of this
4 * source code is governed by a BSD-style license that can be found in the
5 * LICENSE file.
6-->
7<html>
8  <head>
9    <style>
10      html {
11        height: 40px;
12      }
13      body {
14        background: #fffddd;
15        font: 16px Arial;
16        height: 100%;
17        display: -webkit-box;
18        -webkit-box-orient: vertical;
19        -webkit-box-pack: center;
20      }
21      em {
22        font-weight: bold;
23        font-style: normal;
24      }
25    </style>
26  </head>
27  <body>
28    <div id="wrap">
29      The word <em>sandwich</em> appears <em id="count">X</em> times on this
30      page.
31    </div>
32    <script>
33      // Obtain the count of sandwiches from the page URL.
34      var count = window.location.hash.substring(1);
35      if (count) {
36        // Replace the placeholder text with the actual count.
37        var domcount = document.querySelector('#count');
38        domcount.innerText = count;
39      }
40    </script>
41  </body>
42</html>