Skip to content

Instantly share code, notes, and snippets.

YUI('lang', function (Y) {
YAP.toQueryString = function (obj, name) {
switch (Y.Lang.type(obj)) {
case 'undefined':
case 'null':
return name ? encodeURIComponent(name) + '=' : '';
case 'boolean': obj = +obj; // intentional fallthrough
case 'number':
case 'string':
<!DOCTYPE html>
<html>
<head>
<script>
// The signature is pure coincidence ;)
function L(U,C){var d=document,f='firstChild',r='readyState',h=d.documentElement[f],s=d.createElement('script'),m=s[r]:'onreadystatechange':'';s.type='text/javascript';s.src=U;s[m||'onload']=function(){if(!m||/loaded|complete/.test(s[r])){s[m]=null;C()}};h.insertBefore(s,h[f]);}
// async loading of javascript files, starting asap.
L("http://example.com/example.js",function () {
doSomething();
<script type="text/javascript" src="frameworks/yui_2.7.0b/yui/build/yuiloader/yuiloader-debug.js"></script>
<script type="text/javascript" src="js/loader-config.js"></script>
<script type="text/javascript">
(function() {
_yuiloader_config.config.onSuccess = function () {
};
_yuiloader_config.config.onFailure = function () {
};
var loader = new YAHOO.util.YUILoader(_yuiloader_config.config);
<!doctype html>
<html>
<head>
<meta http - equiv = "content-type"content = "text/html; charset=utf-8">
<title>Server - side Pagination and Sorting for Dynamic Data </title>
<link rel="stylesheet" type="text/css " href="datatable2.css " />
<script type="text / javascript " src="js / yahoo - dom - event.js "></script>
<script type="text / javascript " src="js / connection - min.js "></script>
<script type="text / javascript " src="js / dragdrop - min.js "></script>
<script type="text / javascript " src="js / dom - min.js "></script>
/**
* The History Lite utility is similar in purpose to the YUI Browser History
* utility, but with a more flexible API, no initialization or markup
* requirements, limited IE6/7 support, and a much smaller footprint.
*
* @module history-lite
*/
/**
* @class HistoryLite
var CLASS_NAME = "className",
BOUNDING_BOX = "boundingBox",
SKIN_PREFIX = "yui-skin-",
SKIN_REGEXP = new RegExp("(?:^|\\s)" + SKIN_PREFIX + "(\S+)");
...
getActiveSkin : function() {
var match;
this.get(BOUNDING_BOX).ancestor(
var inputs = Y.all( 'input' );
inputs.on( 'focus', function ( e ) {
// NodeList subscriptions use the NodeList as 'this'
this === inputs; // true
// because you can always get to the node from the event's currentTarget,
// but can't get to the NodeList unless you've prefetched it like in this ex
e.currentTarget.get( 'tagName' ) === 'INPUT'; // true
} );
@lsmith
lsmith / matrix.js
Created April 22, 2010 17:39 — forked from apipkin/matrix.js
/**
* DOM Ready
*/
Y.on('domready',function(e){
// code
});
/**
* DOM Basics
*/
Button = Y.Base.create('toolbar-button',Y.Widget,[Y.WidgetChild],{
BOUNDING_TEMPLATE : '<li/>',
CONTENT_TEMPLATE : '<button/>',
_clickHandle : null,
className : '',
initializer : function(config) {
this.className = this.getClassName();
},
YUI.add('example',function(Y){
var Example= function(){
Example.superclass.constructor.apply(this,arguments);
};
Y.extend(Example, Y.Overlay,{
/* proto */
},{