| 1 | <html> |
| 2 | <head> |
| 3 | <title>Simple demo of dojox.help.console</title> |
| 4 | <script src="../../../dojo/dojo.js" type="text/javascript" data-dojo-config="isDebug: true"></script> |
| 5 | <script type="text/javascript"> |
| 6 | dojo.addOnLoad(function(){ |
| 7 | dojo.query("code").onclick(function(e){ |
| 8 | var cmd = e.target.innerHTML; |
| 9 | if(cmd.slice(-1) == ";"){ |
| 10 | dojo.eval(cmd); |
| 11 | }else{ |
| 12 | console.log(dojo.getObject(cmd)); |
| 13 | } |
| 14 | }); |
| 15 | }); |
| 16 | </script> |
| 17 | </head> |
| 18 | <body> |
| 19 | <p>You'll want to open up Firebug for this</p> |
| 20 | <p>Click each of the items below to run the command:</p> |
| 21 | <ul> |
| 22 | <li><code>dojo.require("dojox.help.console");</code></li> |
| 23 | <li><code>dojox.help.locate("Xhr", dojo);</code> searches variable names in the dojo namespaces for "Xhr" (no matter the case).</li> |
| 24 | <li><code>dojo.query.help();</code> displays help for dojo.byId</li> |
| 25 | <li><code>dojo.connect</code> loads and displays the function signature for dojo.connect</li> |
| 26 | <li><code>dojo.isBrowser</code> shows an example of a "conflict". It's using the Boolean object rather than the boolean generic.</li> |
| 27 | <li><code>dojox.help.noConflict();</code> fixes this conflict (click on <code>dojo.isBrowser</code> again).</li> |
| 28 | <li><code>dojox.help.refresh();</code> parses the page again!</li> |
| 29 | <li><code>dojo.isBrowser</code> and the conflict is back again!</li> |
| 30 | </ul> |
| 31 | </body> |
| 32 | </html> |