Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 83 lines (73 sloc) 3.116 kB
8bb917c @davglass Adding YUI Tools Source
authored
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html>
3 <head>
4 <title>YUI: YAHOO.Tools</title>
5 <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.3.1/build/reset-fonts-grids/reset-fonts-grids.css">
6 <link rel="stylesheet" href="http://blog.davglass.com/wp-content/themes/davglass/style.css" type="text/css">
7 <style type="text/css" media="screen">
8 p, h2 {
9 margin: 1em;
10 }
11 </style>
12 </head>
13 <body>
14 <div id="davdoc" class="yui-t7">
15 <div id="hd"><h1 id="header"><a href="http://blog.davglass.com/">YUI: YAHOO.Tools</a></h1></div>
16 <div id="bd">
17 <p>General tools. <a href="../docs/?type=tools">Docs available here</a> - <a href="tools-min.js">Minimized source here</a></p>
18 <h2>JSON Parsing</h2>
19 <p>The YAHOO.Tools package now includes a version of <a href="http://www.json.org/js.html">Douglas Crockford's</a> JSON.js file that doesn't mess with the object prototypes.</p>
20 <p>You can see an example of the <a href="json.php">JSON parser here</a>.</p>
21 <h2>Browser Engine Object</h2>
22 <p>YAHOO.Tools.getBrowserEngine();</p>
23 <p>This function attempts to identify the core browsers through object detection. However, a developer may trash this detection by adding "functionality" to a page.</p>
24 <p>Go ahead, change your User Agent string. This should still work 8-)</p>
25 <p id="browser_engine"></p>
26 <h2>Browser Agent Object</h2>
27 <p>YAHOO.Tools.getBrowser();</p>
28 <p>This function uses the User Agent string to determine it's information. It will be fooled by a User Agent switcher</p>
29 <p id="browser_agent"></p>
30 <h2>Current Functions in YAHOO.Tools</h2>
31 <p id="tools_info"></p>
32 </div>
33 <div id="ft">&nbsp;</div>
34 </div>
35
36
37
38 <script type="text/javascript" src="http://yui.yahooapis.com/2.3.1/build/utilities/utilities.js"></script>
39 <script type="text/javascript" src="tools.js"></script>
40 <script type="text/javascript" src="../js/effects-min.js"></script>
41 <script type="text/javascript" src="../js/davglass.js"></script>
42 <script type="text/javascript">
43
44
45 function init() {
46 var br = $T.getBrowserAgent();
47 var str = '';
48 for (var i in br) {
49 if (br[i] && (i != 'ua')) {
50 str += '<b>' + i + ': ' + br[i] + '</b><br>';
51 } else {
52 str += i + ': ' + br[i] + '<br>';
53 }
54 }
55 $('browser_agent').innerHTML = str;
56
57 var bro = $T.getBrowserEngine();
58 var str = '';
59 for (var i in bro) {
60 if (bro[i] && (i != 'ua')) {
61 str += '<b>' + i + ': ' + bro[i] + '</b><br>';
62 } else {
63 str += i + ': ' + bro[i] + '<br>';
64 }
65 }
66 $('browser_engine').innerHTML = str;
67
68 str = '';
69 for (var i in YAHOO.Tools) {
70 if ((i != 'prototype') && (i.toLowerCase() != 'version') && (i.toLowerCase() != 'build')) {
71 str += i + '<br>';
72 }
73 }
74 $('tools_info').innerHTML = str;
75 }
76
77 $E.addListener(window, 'load', init);
78
79 </script>
80 </body>
81 </html>
82 <?php @include_once($_SERVER["DOCUMENT_ROOT"]."/wp-content/plugins/shortstat/inc.stats.php"); ?>
Something went wrong with that request. Please try again.