Browser mode is now standard
[pazpar2-moved-to-github.git] / www / iphone / index2.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
4 <html xmlns="http://www.w3.org/1999/xhtml">
5  
6  <head>
7   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8   <title>Pazpar2 demo client</title>
9   <link rel="stylesheet" href="styles.css"></link>
10
11   <script>
12     var count = 0;
13     var termlist = {};
14     var JSON = JSON || {};
15
16     // implement JSON.stringify serialization
17     JSON.stringify = JSON.stringify || function (obj) {
18     var t = typeof (obj);
19     if (t != "object" || obj === null) {
20     // simple data type
21     if (t == "string") obj = '"'+obj+'"';
22     return String(obj);
23     }
24     else {
25     // recurse array or object
26     var n, v, json = [], arr = (obj && obj.constructor == Array);
27     for (n in obj) {
28     v = obj[n]; t = typeof(v);
29     if (t == "string") v = '"'+v+'"';
30     else if (t == "object" && v !== null) v = JSON.stringify(v);
31     json.push((arr ? "" : '"' + n + '":') + String(v));
32     }
33     return (arr ? "[" : "{") + String(json) + (arr ? "]" : "}");
34     }
35     };
36
37     function search(message) 
38     {
39       var body = document.getElementById("body");
40       body.innerHTML = message;
41       count = count + 1;
42       //document.location = "myapp:myfunction:record:" + count ":value1:value2:value3";
43       termlist[message] = count + 1;
44       document.location = "myapp:" + "myfunction:" + count + ":" + message + ":" + JSON.stringify(termlist));
45     }
46
47
48   </script>
49
50  </head>
51
52  <body onload="">
53    <div id="body">
54    </div>
55    <div id="callback">
56      <a href="myapp:myfunction:record:id:value1:value2:value3">callback</a>
57    </div>
58  </body>
59 </html>
60