<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>YUI Coder &#187; YUI Mish Mash</title>
	<atom:link href="http://www.yuicoder.com/category/yui_mish_mash/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.yuicoder.com</link>
	<description>Manipulating the Yahoo User Interface to your will!</description>
	<lastBuildDate>Fri, 19 Mar 2010 23:59:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Microsoft Loves jQuery</title>
		<link>http://www.yuicoder.com/2010/03/microsoft-loves-jquery/</link>
		<comments>http://www.yuicoder.com/2010/03/microsoft-loves-jquery/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 23:59:12 +0000</pubDate>
		<dc:creator>Jeffrey Cobb</dc:creator>
				<category><![CDATA[YUI Mish Mash]]></category>

		<guid isPermaLink="false">http://www.yuicoder.com/?p=182</guid>
		<description><![CDATA[From&#160;Ajaxian
Update: Here is a full set of release notes on the platform preview (called that as it is more of a shell than a&#160;browser.
Rey Bango (Ajaxian and now Microsoft employee) will do a post that rounds up the news from MIX today where the IE9 team shared a first preview release of IE9 that comes [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://ajaxian.com/archives/microsoft-loves-jquery">From&nbsp;Ajaxian</a></p>
<p>Update: Here is a <a href="http://ie.microsoft.com/testdrive/info/releasenotes/">full set of release notes</a> on the platform preview (called that as it is more of a shell than a&nbsp;browser.</p>
<p>Rey Bango (Ajaxian and now Microsoft employee) will do a post that rounds up the news from MIX today where the IE9 team shared <a href="http://ie.microsoft.com/testdrive/">a first preview release of IE9 </a>that comes with new features from HTML5+ (video, SVG, CSS3, addEventListener, JavaScript compilation spread across multicore, and more). All of this is hardware accelerated. Yum. Missing was news on canvas and I didn&#8217;t see deets on CSS transforms and the like (which would be awesome with hardware acceleration&nbsp;too).</p>
<p>John Resig just got on stage to talk about the collaboration between jQuery and Microsoft and how Microsoft is now contribution resources and code. For example, templates  (all on GitHub  which gives you:&#8230;.<a href="http://ajaxian.com/archives/microsoft-loves-jquery">MORE</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.yuicoder.com/2010/03/microsoft-loves-jquery/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>YUI DataTable: Context Menu with &#8220;Select/Unselect All&#8221; rows</title>
		<link>http://www.yuicoder.com/2009/11/yui-datatable-context-menu-with-selectunselect-all-rows/</link>
		<comments>http://www.yuicoder.com/2009/11/yui-datatable-context-menu-with-selectunselect-all-rows/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 12:26:06 +0000</pubDate>
		<dc:creator>Jeffrey Cobb</dc:creator>
				<category><![CDATA[YUI Datatable]]></category>
		<category><![CDATA[YUI Mish Mash]]></category>

		<guid isPermaLink="false">http://www.yuicoder.com/?p=171</guid>
		<description><![CDATA[Andy from Coderfoo.com created this excellent example and code sniplet to demo a function he created that uses a context menu to select and deselect all rows from a YUI datatable. At first I simply thought he was just accessing a regular function within YUI but he soon corrected me. He explained that while YUI [...]]]></description>
			<content:encoded><![CDATA[<p>Andy from <a href="http://www.coderfoo.com">Coderfoo.com</a> created this excellent example and code sniplet to demo a function he created that uses a context menu to select and deselect all rows from a YUI datatable. At first I simply thought he was just accessing a regular function within YUI but he soon corrected me. He explained that while YUI has a deselect function for all rows a select all function did not exist. So knowing Andy he took on the challenge of creating this function. Thanks again Andy for sharing your code with us.<br />
Working Example on <a href="http://www.coderfoo.com">CoderFoo.com</a>&nbsp;<a href="http://www.coderfoo.com/examples/datatable-multi-row-select.html">http://www.coderfoo.com/examples/datatable-multi-row-select.html</a></p>
<h2>Get the&nbsp;code</h2>
<pre>
<textarea name="code" class="JavaScript" cols="60" rows="10">
YAHOO.lang.augmentObject(
  YAHOO.widget.DataTable.prototype, {
    _selectAllTrEls : function() {
      var selectedRowsEven = YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_EVEN, "tr",this._elTbody);
      YAHOO.util.Dom.addClass( selectedRowsEven , YAHOO.widget.DataTable.CLASS_SELECTED);
      var selectedRowsOdd = YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_ODD, "tr",this._elTbody);
      YAHOO.util.Dom.addClass( selectedRowsOdd, YAHOO.widget.DataTable.CLASS_SELECTED);
    },
  /* Selects all rows. * * @method selectAllRows */
  selectAllRows : function() {
    // Remove all rows from tracker
    var tracker = this._aSelections || [];
    for(var j=tracker.length- 1; j>-1; j--) {
      if(YAHOO.lang.isString( tracker[j] )){
        tracker.splice( j,1);
      }
    }
    // Update tracker
    this._aSelections = tracker;
    // Update UI
    this._selectAllTrEls();
    // Get all highlighted rows and make yahoo aware they are selected
    var selectedRowsEven = YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_SELECTED, "tr",this._elTbody);
    for (i=0;i
<selectedRowsEven.length; i++){
      this.selectRow(i);
    }
  }
});
</textarea>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.yuicoder.com/2009/11/yui-datatable-context-menu-with-selectunselect-all-rows/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Simple YUI Login using Ajax, Cookies and server side auth</title>
		<link>http://www.yuicoder.com/2009/10/simple-yui-login-using-ajax-cookies-and-server-side-auth/</link>
		<comments>http://www.yuicoder.com/2009/10/simple-yui-login-using-ajax-cookies-and-server-side-auth/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 19:23:09 +0000</pubDate>
		<dc:creator>Jeffrey Cobb</dc:creator>
				<category><![CDATA[YUI Mish Mash]]></category>

		<guid isPermaLink="false">http://www.yuicoder.com/?p=150</guid>
		<description><![CDATA[JavaScript&#160;[login.js]



// set up YUI loader
var loader = new YAHOO.util.YUILoader({
    require: ["container","connection",
              "cookie",
              "animation",
              [...]]]></description>
			<content:encoded><![CDATA[<h2>JavaScript&nbsp;[login.js]</h2>
<p></p>
<pre>
<textarea name="code" class="JavaScript" cols="60" rows="10">
// set up YUI loader
var loader = new YAHOO.util.YUILoader({
    require: ["container","connection",
              "cookie",
              "animation",
              "button",
              "dom","event"
              ],
   loadOptional: true,
   onSuccess: function() {
	Yevent = YAHOO.util.Event;
	Yconnect = YAHOO.util.Connect;
	Ydom = YAHOO.util.Dom;
	Ycook = YAHOO.util.Cookie;
// fire of init() function once the document has finished loading and the dom is ready
    YAHOO.util.Event.onDOMReady(init);
	},
	timeout: 10000,
	allowRollup: true,
	base: '/scripts/yui/build/',
	combine: false
});
loader.insert();

function init() {

 // Create a dialog box to put the login form into
  	    stdDialog = new YAHOO.widget.SimpleDialog("dlgstd", {
	    width: "auto",
	    fixedcenter:true,
	    modal:false,
	    visible:false,
	    close: false,
	    constraintoviewport: true
	  });
	     stdDialog.setHeader("Login:");
	     stdDialog.render(document.body);

  var buttons=[{ text:"Login", handler: function(){
  var loginCallback = {
       cache:false,
       success: function(o){
         response = o.responseText.split(",");
         if(response[0] == "ok"){
          stdDialog.setHeader("Login: Success");
          YAHOO.util.Cookie.set(response[1], response[2], {});
document.location.href = "dashboard.pl";
						}
						else {
							stdDialog.setHeader("Login: Failed, Please Try Again");
						}
	    				},
	    				failure: function(o){
	    					alert('ERROR! Connection to server failed! Please try again.');
	    					}
	    		    };
		var formObject = document.getElementById('login');
		YAHOO.util.Connect.setForm(formObject);
		var username = formObject.username.value;
		var password = formObject.password.value;
		if(username == ""){
			stdDialog.setHeader("Login: Username field is empty");
			var error = 1;
		}
		else if(password == ""){
			stdDialog.setHeader("Login: Password field is empty");
			var error = 1;
		}
		if(!error){
		var cObj = YAHOO.util.Connect.asyncRequest('POST', 'login.pl', loginCallback);
		}

	}, isDefault:true }];
		stdDialog.cfg.setProperty("buttons", buttons);
		stdDialog.cfg.setProperty("postmethod", 'async');
	    stdDialog.cfg.setProperty("text",'
<form id=login method=post action=login.pl>
<table>
<tr>
<td><b>Username:</b></td>
<td>
<input type=text name=username id=username></td>
</tr>
<tr>
<td><b>Password:</b></td>
<td>
<input type=password name=password id=pass>
<input type=hidden name=action value=login></td>
</tr>
</table>
</form>

');

		stdDialog.show();

}
</textarea>
</pre>
<h2>Perl Script&nbsp;[login.pl]</h2>
<pre>
<textarea name="code" class="JavaScript" cols="60" rows="10">
#!/usr/bin/perl
use CGI qw(:standard);
$query = new CGI;

if($query->param('action') eq 'login'){
print "Context-type: text/html \n\n";
# Here is where we define the username and password for authent
 if($query->param('username') eq 'username' &#038;&#038; $query->param('password') eq 'password'){
 print "ok,someRandomKeyShouldGoHere," . $query->param('username');
 }
 else {
  print "no";
 }
 exit;
}

  print header;
  print start_html(-title=>'Login',
                   -style=>{src=>'/scripts/yui/build/fonts/fonts.css'},
                   -script=>[{-type => 'text/javascript',-src =>'yui/build/yuiloader/yuiloader-min.js'},
{-type => 'text/javascript',-src =>'login.js'}],
                   -class=>'yui-skin-sam'
                   );
 print end_html;
</textarea>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.yuicoder.com/2009/10/simple-yui-login-using-ajax-cookies-and-server-side-auth/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>YUI TreeView with Drag and Drop nodes</title>
		<link>http://www.yuicoder.com/2009/07/yui-treeview-with-drag-and-drop-nodes/</link>
		<comments>http://www.yuicoder.com/2009/07/yui-treeview-with-drag-and-drop-nodes/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 19:38:28 +0000</pubDate>
		<dc:creator>Jeffrey Cobb</dc:creator>
				<category><![CDATA[YUI Mish Mash]]></category>

		<guid isPermaLink="false">http://www.yuicoder.com/2009/07/yui-treeview-with-drag-and-drop-nodes/</guid>
		<description><![CDATA[Andy created a very and useful advanced example of using the Yahoo! User Interface TreeView with the capabilites of drag and drop of child nodes to other parent nodes. Here is an exert of his blog and the&#160;link.


$coderfoo: YUI TreeView with Drag and Drop nodes

I recently had a need for a YUI (Yahoo User Interface) [...]]]></description>
			<content:encoded><![CDATA[<p>Andy created a very and useful advanced example of using the Yahoo! User Interface TreeView with the capabilites of drag and drop of child nodes to other parent nodes. Here is an exert of his blog and the&nbsp;link.</p>
<fieldset>
<legend>
<a href="http://www.coderfoo.com/blog" target="_blank">$coderfoo</a>: <a title="YUI TreeView with Drag and Drop nodes" href="http://www.coderfoo.com/blog/2009/07/yui-treeview-with-drag-and-drop-nodes.html" target="_blank">YUI TreeView with Drag and Drop nodes</a><br />
</legend>
<p>I recently had a need for a YUI (Yahoo User Interface) TreeView with Drag &amp; Drop nodes.  Here&#8217;s a little background on the project.  My web application uses YUI Menu for navigation and is driven by a single database table.  Initially I threw together a quick and dirty CGI CRUD interface to manage the menu.  But, the more I had to modify the menu with this interface the more I needed something easier to use.  So I decided to scrap the CGI interface and start over with a nice 100% Ajax interface with a YUI TreeView to represent the YUI Menu.  Adding, changing, and deleting nodes is pretty easy, but to easily change the order of the Menu items, I added YUI Drag &amp; Drop to the TreeView&#8230;..<a title="YUI TreeView with Drag and Drop nodes" href="http://www.coderfoo.com/blog/2009/07/yui-treeview-with-drag-and-drop-nodes.html" target="_blank">[MORE]</a><br />
</fieldset>
]]></content:encoded>
			<wfw:commentRss>http://www.yuicoder.com/2009/07/yui-treeview-with-drag-and-drop-nodes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a FIXED element with re-size and scroll detection using YUI dom and event</title>
		<link>http://www.yuicoder.com/2009/03/creating-a-fixed-element-with-re-size-and-scroll-detection-using-yui-dom-and-event/</link>
		<comments>http://www.yuicoder.com/2009/03/creating-a-fixed-element-with-re-size-and-scroll-detection-using-yui-dom-and-event/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 00:05:05 +0000</pubDate>
		<dc:creator>Jeffrey Cobb</dc:creator>
				<category><![CDATA[YUI Loader]]></category>
		<category><![CDATA[YUI Mish Mash]]></category>
		<category><![CDATA[YUI Util DOM]]></category>
		<category><![CDATA[createElement]]></category>
		<category><![CDATA[Get]]></category>
		<category><![CDATA[getPreviousSibling()]]></category>
		<category><![CDATA[getViewPortHeight()]]></category>
		<category><![CDATA[getViewPortWidth()]]></category>
		<category><![CDATA[inDocument()]]></category>
		<category><![CDATA[insertAfter]]></category>
		<category><![CDATA[setStyle()]]></category>
		<category><![CDATA[window.resize]]></category>
		<category><![CDATA[YAHOO.Dom.Event]]></category>
		<category><![CDATA[YAHOO.util.Event.addListner]]></category>
		<category><![CDATA[YUI Event]]></category>

		<guid isPermaLink="false">http://www.yuicoder.com/?p=85</guid>
		<description><![CDATA[We have all see them and some of us love them. It&#8217;s those elements that seem to float on the page like hovering little angels. Ok enough with the sappy crap&#8230;down to business. So you need to create a browser independent simple script to position an element on a page. I put together a simple [...]]]></description>
			<content:encoded><![CDATA[<p>We have all see them and some of us love them. It&#8217;s those elements that seem to float on the page like hovering little angels. Ok enough with the sappy crap&#8230;down to business. So you need to create a browser independent simple script to position an element on a page. I put together a simple script that will handle such a task and is flexible enough for even a newbie to&nbsp;configure. </p>
<p>In this example my task is to create a footer element that will stay on the bottom of the browser window during re-size and scroll events.<a href="http://yuicoder.com/examples/fixedFooter.html" target="blank">View the completed&nbsp;project</a>\n</p>
<h2>CSS</h2>
<p>First you will need to specify the position and size of your&nbsp;element.</p>
<pre>
<textarea name="code" class="css" cols="60" rows="10">#screenFooter {
  position: absolute;
	left: 0px;
	top: 0px;
	width: 100%;
	height: 25px;}
</textarea>
</pre>
<h2>HTML</h2>
<p>Assign your element an&nbsp;ID!</p>
<pre>
<textarea name="code" class="html" cols="60" rows="10">
<div id="screenFooter">YuiCoder.com</div>

</textarea>
</pre>
<h2>Javascript</h2>
<p>Insert the following code to the bottom of the page just before the body tag.<br />
In this example I am using the YUI Loader to speed up deployment of my examples. You do not need to user YUI Loader but remember you will need to load the yahoo, dom and event scripts from the YUI Library in order for this to&nbsp;work.</p>
<pre>
<textarea name="code" class="javascript" cols="60" rows="10">
<!--
var loader = new YAHOO.util.YUILoader({
    require: ["dom","event"],
    loadOptional: true,
    onSuccess: function() {
    Ydom = YAHOO.util.Dom;

// Start LoadFooter Code
// Fires of the LoadFooter function when the browser dom is ready
Yevent.onDOMReady(LoadFooter);

// Scroll event listner
YAHOO.util.Event.addListener(window, 'scroll',
    function(){
       var Ydom = YAHOO.util.Dom;
       Ydom.setStyle(Ydom.get('screenFooter'),'visibility','hidden');
       LoadFooter();
      }
);

YAHOO.util.Event.addListener(window, 'resize', LoadFooter );
},
    timeout: 10000,
    combine: true
});
loader.insert();

function LoadFooter(){
// Get the footer element as an object
var footer = Ydom.get('screenFooter');
// Get the element loaded BEFORE the footer
var footer2 = Ydom.getPreviousSibling(footer);

    // Create an element just before the footer. This will ensure the footer does not hide anything
	//on the bottom of your page
    if(!Ydom.inDocument('footerBreak') ){
      var b = document.createElement('div');
          b.style.height = '37px';
          b.id = 'footerBreak';
       Ydom.insertAfter(b,footer2);
    }

    // Get the document scroll TOP position
    var sfS = Ydom.getDocumentScrollTop();
	// Get the document ViewPort size - subtract the footer size then add the scroll top position
    var sfH = Ydom.getViewportHeight() - 37 + sfS;
	// Note if you are dealing with an element that is smaller than 100% of the document viewport
	// add calculations for the getViewportWidth() for horizonal scrolling detection

	// Here we set the style properties of the footer
    Ydom.setStyle(footer,'position','absolute');
    Ydom.setStyle(footer,'top',sfH+'px');
    Ydom.setStyle(footer,'visibility','visible');
}

-->
</textarea>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.yuicoder.com/2009/03/creating-a-fixed-element-with-re-size-and-scroll-detection-using-yui-dom-and-event/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Override alert() with a YUI Dialog</title>
		<link>http://www.yuicoder.com/2009/03/override-alert-with-a-yui-dialog/</link>
		<comments>http://www.yuicoder.com/2009/03/override-alert-with-a-yui-dialog/#comments</comments>
		<pubDate>Sun, 08 Mar 2009 12:34:18 +0000</pubDate>
		<dc:creator>Jeffrey Cobb</dc:creator>
				<category><![CDATA[Dialog]]></category>
		<category><![CDATA[YUI Animation]]></category>
		<category><![CDATA[YUI Container]]></category>
		<category><![CDATA[YUI Get]]></category>
		<category><![CDATA[YUI Loader]]></category>
		<category><![CDATA[YUI Mish Mash]]></category>
		<category><![CDATA[Container]]></category>
		<category><![CDATA[Panel]]></category>
		<category><![CDATA[Simple Dialog]]></category>
		<category><![CDATA[window.alert]]></category>

		<guid isPermaLink="false">http://www.yuicoder.com/?p=51</guid>
		<description><![CDATA[You know and I know and everyone knows the alert boxes generated by the browsers are OLD-SCHOOL and look like garbage. Well using YUI you can easily change that by just including a little code in you page. Simply add the code below to the bottom of your page just before the end body tag [...]]]></description>
			<content:encoded><![CDATA[<p>You know and I know and everyone knows the alert boxes generated by the browsers are OLD-SCHOOL and look like garbage. Well using YUI you can easily change that by just including a little code in you page. Simply add the code below to the bottom of your page just before the end body tag then add the body style to the begining body tag called &#8220;yui-skin-sam&#8221; and that&#8217;s it. Oh and don&#8217;t forget to include your YUI Framework base and the additional scripts &#8220;container&#8221;, &#8220;dragdrop&#8221; and &#8220;animation&#8221;. For an example on how to included the YUI Framework and load specific parts check out <a href="http://www.yuicoder.com/2009/03/override-alert-with-a-yui-dialog/">for a quick start guide for YUI Loader and Yahoo&nbsp;CDN</a>.</p>
<pre name="code" class="JavaScript">
AlertDialog = new YAHOO.widget.SimpleDialog("dlg1", {
  width: "200px",
  effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.15},
  fixedcenter:true,
  modal:true,
  visible:false,
  close: true,
  constraintoviewport: true,
  buttons: [ { text:"close", handler: function(){this.hide();}, isDefault:true }],
  draggable:false,
                effect: [
                      { effect:YAHOO.widget.ContainerEffect.FADE,duration:0.1 }]
});

AlertDialog.setHeader("Alert");
AlertDialog.render(document.body);
window.alert = function(text) {
  AlertDialog.cfg.setProperty("text",text);
  AlertDialog.show();
};
</pre>
<p><a href="#" onclick="alert('Hello');return false; ">Click HERE</a> for an&nbsp;example:</p>
<h3>A permanent&nbsp;solution!</h3>
<p>If you would like to override the alert box throughout your entire site or application, save the code to your server in a public script folder. Example: as alertBox.js. Then load the script using YUI Get with-in the YUI Loader BEFORE firing off your init() routine. Here is an&nbsp;example.</p>
<pre name="code" class="JavaScript">
<script src="http://yui.yahooapis.com/2.7.0/build/yuiloader/yuiloader-min.js"</script>

<script>
var loader = new YAHOO.util.YUILoader({
    require: ["get","dom","event"],
    loadOptional: true,
    onSuccess: function() {
    Yevent = YAHOO.util.Event;
    Ydom = YAHOO.util.Dom;
    var objTransaction = YAHOO.util.Get.script("http://www.yuicoder.com/scripts/application/view/alertBox.js",	
{ onSuccess: function() {
                    	alert("file loaded");
                             });
    Yevent.onDOMReady(init);
    },
    timeout: 10000,
    combine: true
});
loader.insert();
function init(){
console.warn('YUI Loaded');
}
</script>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.yuicoder.com/2009/03/override-alert-with-a-yui-dialog/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Using the YUI Loader and Yahoo&#8217;s CDN Rollup</title>
		<link>http://www.yuicoder.com/2009/03/using-the-yui-loader-and-yahoos-cdn-rollup/</link>
		<comments>http://www.yuicoder.com/2009/03/using-the-yui-loader-and-yahoos-cdn-rollup/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 21:07:04 +0000</pubDate>
		<dc:creator>Jeffrey Cobb</dc:creator>
				<category><![CDATA[YUI Loader]]></category>
		<category><![CDATA[YUI Mish Mash]]></category>
		<category><![CDATA[Event]]></category>
		<category><![CDATA[FireBug]]></category>
		<category><![CDATA[Get]]></category>
		<category><![CDATA[HTML DOM]]></category>
		<category><![CDATA[init()]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[onDomReady]]></category>
		<category><![CDATA[Rollup]]></category>
		<category><![CDATA[Yahoo User Interface]]></category>
		<category><![CDATA[YUI Framework]]></category>

		<guid isPermaLink="false">http://www.yuicoder.com/?p=26</guid>
		<description><![CDATA[Using the YUI Loader and the script below will allow you to implement the YUI framework within your application with out downloading and installing the YUI framework to your&#160;server.


 
var loader = new YAHOO.util.YUILoader({
    require: ["get","dom","event"],
    loadOptional: true,
    onSuccess: function() {
    YAHOO.util.Event.onDOMReady(init);
  [...]]]></description>
			<content:encoded><![CDATA[<p>Using the YUI Loader and the script below will allow you to implement the YUI framework within your application with out downloading and installing the YUI framework to your&nbsp;server.</p>
<pre name="code" class="JavaScript">
<script src="http://yui.yahooapis.com/2.7.0/build/yuiloader/yuiloader-min.js"></script>
<script> 
var loader = new YAHOO.util.YUILoader({
    require: ["get","dom","event"],
    loadOptional: true,
    onSuccess: function() {
    YAHOO.util.Event.onDOMReady(init);
    },
    timeout: 10000,
    combine: true
});
loader.insert();

function init(){
console.warn('YUI Loaded');
}
</script>
</pre>
<h3>Verify&nbsp;Installation:</h3>
<p>I have included a console function that will send a warning to your FireBug application telling you that everything has loaded correctly. If you run this code and see the warning message in your FireBug console, then your code is installed&nbsp;correctly.</p>
<h3>Adding your own&nbsp;code:</h3>
<p>Replace the following line with your code and your ready to&nbsp;run.</p>
<pre name="code" class="JavaScript">
console.warn('YUI Loaded');
</pre>
<h3>Adding resources from&nbsp;YUI:</h3>
<p>In order to use specific parts of the YUI framework you will need to request the files from the YUI CDN. To do this simply add the required YUI library to the require array as shown&nbsp;below.</p>
<pre name="code" class="JavaScript">
"require: ["get","dom","event","datatable","animation"],
</pre>
<h3>Things to&nbsp;remember</h3>
<p>
The YUI Loader may cause problems when working with older browsers such as IE6. Be sure to wrap you loader using the onDOMReady method like&nbsp;so.</p>
<pre name="code" class="JavaScript">
Yevent.onDOMReady(init);</pre>
<p>This will ensure that the browser has finished loading the DOM before firing off your&nbsp;scripts.</p>
<p> UPDATED (2009-07-22):  &#8220;missing > in code and removed Yevent&nbsp;shortcuts&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yuicoder.com/2009/03/using-the-yui-loader-and-yahoos-cdn-rollup/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
