1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<!--
You are free to copy and use this sample in accordance with the terms of the
Apache license (http://www.apache.org/licenses/LICENSE-2.0.html)
-->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Google AJAX Search API Sample</title>
    <script src="http://www.google.com/jsapi?key=AIzaSyA5m1Nc8ws2BbmPRwKu5gFradvD_hgq6G0" type="text/javascript"></script>
    <script type="text/javascript">
    /*
    *  How to load jQuery and then use the Search API with it.
    */

    google.load("jquery", "1");

    // on page load complete, fire off a jQuery json-p query
    // against Google web search
    function OnLoad(){
      page = "about"; // use document.location.href.split("/")[3];
      $('li.menuitems a[href*='+page+']').each( function() {
          $(this).replaceWith($(this).html());
      });
    }

    google.setOnLoadCallback(OnLoad);
    </script>
  </head>
  <body style="font-family: Arial;border: 0 none;">
    <ul id="menu"> 
           <li class="menuitems"><a href="/">Home</a> </li> 
           <li class="menuitems"><a href="/about/">About Us</a> </li> 
           <li class="menuitems"><a href="/contact/">Contact Us</a> </li> 
    </ul>

  </body>
</html>