Last change
on this file since 256 was
256,
checked in by hendrikvanantwerpen, 13 years ago
|
Reworked project structure based on REST interaction and Dojo library. As
soon as this is stable, the old jQueryUI branch can be removed (it's
kept for reference).
|
File size:
1.1 KB
|
Line | |
---|
1 | <html> |
---|
2 | <head> |
---|
3 | <title> |
---|
4 | Yahoo Search Demo |
---|
5 | </title> |
---|
6 | <script src="../../../dojo/dojo.js" type="text/javascript" |
---|
7 | djConfig="parseOnLoad: true, isDebug: true"></script> |
---|
8 | <script type="text/javascript"> |
---|
9 | dojo.require("dojo.io.script") |
---|
10 | dojo.require("dojox.rpc.Service"); |
---|
11 | dojo.require("dijit._Widget"); |
---|
12 | dojo.require("dojox.dtl._Templated"); |
---|
13 | dojo.require("dojo.parser"); |
---|
14 | |
---|
15 | dojo.declare("YahooWebSearchApiWidget", [dijit._Widget, dojox.dtl._Templated], { |
---|
16 | constructor: function(params, node){ |
---|
17 | var mu = dojo.moduleUrl("dojox.rpc.SMDLibrary", "yahoo.smd"); |
---|
18 | this.yahoo = new dojox.rpc.Service(mu); |
---|
19 | }, |
---|
20 | onSearch: function(e){ |
---|
21 | if(e.keyCode == dojo.keys.ENTER){ |
---|
22 | this.yahoo.webSearch({ |
---|
23 | query: e.target.value |
---|
24 | }).addCallback(this, function(results){ |
---|
25 | console.debug(results.ResultSet); |
---|
26 | this.results = results.ResultSet; |
---|
27 | this.render(); |
---|
28 | }); |
---|
29 | } |
---|
30 | }, |
---|
31 | templateString: dojo.cache("dojox.rpc.demos.templates", "yahoo.html") |
---|
32 | }); |
---|
33 | </script> |
---|
34 | </head> |
---|
35 | <body> |
---|
36 | <h1>Yahoo Web Search</h1> |
---|
37 | <div dojoType="YahooWebSearchApiWidget"></div> |
---|
38 | </body> |
---|
39 | </html> |
---|
Note: See
TracBrowser
for help on using the repository browser.