summaryrefslogtreecommitdiffstats
path: root/emacs.d/nxhtml/tests/in/mjt-imagesearch.html
blob: 1ec9cd85846aef1591a5983e26ab61a5b515d6fa (plain)
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
40
41
42
43
44
45
46
<!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" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>mjt yahoo test</title>
<script type="text/javascript" src="http://mjtemplate.org/dist/mjt-0.6/mjt.js"></script>
<script type="text/javascript" src="http://mjtemplate.org/dist/mjt-0.6/src/yahooapi/yahooapi.js"></script>
</head>
<body onload="mjt.run('top')">
<h2>Yahoo image search example</h2>
using
<a href="http://mjtemplate.org">mjt</a>
to interact with the
<a href="http://developer.yahoo.com/common/json.html">yahoo json api</a>
<div id="top" style="display:none;">
<div mjt.task="o">
       mjt.yahooapi.ImageSearch(mjt.urlquery.query||'kathakali')
    </div>
<form method="get" action="">
<div>
<input type="text" name="query" value="${mjt.urlquery.query||''}" />
<input type="submit" value="search" />
</div>
</form>
<div mjt.choose="o.state">
<div mjt.when="ready">
<div mjt.for="img in o.result.Result">
<h3>$img.Title</h3>
<img alt="image" src="#" mjt.src="$img.Thumbnail.Url" style="float:left" />
<div>$img.Summary</div>
<hr style="clear:both" />
</div>
</div>
<div mjt.when="wait">
        loading...
      </div>
<div mjt.when="error">
<div mjt.for="msg in o.messages">
          $msg.message
        </div>
</div>
</div>
</div>
</body>
</html>