<?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>Social Vitamin &#187; Ajax</title>
	<atom:link href="http://www.socialvitamin.com/category/ajax/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.socialvitamin.com</link>
	<description>Give your social space a vitamin boost.</description>
	<lastBuildDate>Tue, 17 Aug 2010 20:34:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Yahoo! Query Language (YQL)</title>
		<link>http://www.socialvitamin.com/2009/07/10/yahoo-query-language-yql/</link>
		<comments>http://www.socialvitamin.com/2009/07/10/yahoo-query-language-yql/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 15:09:18 +0000</pubDate>
		<dc:creator>Michael D. Irizarry</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[yahoo]]></category>
		<category><![CDATA[yql]]></category>

		<guid isPermaLink="false">http://www.socialvitamin.com/?p=224</guid>
		<description><![CDATA[The Yahoo! Query Language is an expressive SQL-like language that lets you query, filter, and join data across Web services. With YQL, apps run faster with fewer lines of code [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://developer.yahoo.com/yql/">Yahoo! Query Language</a> is an expressive SQL-like language that lets you query, filter, and join data across Web services. With YQL, apps run faster with fewer lines of code and a smaller network footprint.</p>
<p>Yahoo! and other websites across the Internet make much of their structured data available to developers, primarily through Web services. To access and query these services, developers traditionally endure the pain of locating the right URLs and documentation to access and query each Web service.</p>
<p>With YQL, developers can access and shape data across the Internet through one simple language, eliminating the need to learn how to call different APIs.</p>
<h3>How Do I Get Started?</h3>
<ol>
<li>Check out the YQL <a href="http://developer.yahoo.com/yql/console/" target="_blank">Console</a>.</li>
<li>Read how to access YQL from <a href="http://developer.yahoo.com/yql/guide/running-chapt.html" target="_blank">your application</a>.</li>
<li>Get your <a href="http://developer.yahoo.com/dashboard/createKey.html" target="_blank">API Keys</a> to sign your requests if you <a href="http://developer.yahoo.com/yql/guide/authorization-access.html" target="_blank">need them</a>.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.socialvitamin.com/2009/07/10/yahoo-query-language-yql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 jQuery 1.3 Tips and Tricks for everyday use</title>
		<link>http://www.socialvitamin.com/2009/05/18/10-jquery-13-techniques-you-cant-live-without/</link>
		<comments>http://www.socialvitamin.com/2009/05/18/10-jquery-13-techniques-you-cant-live-without/#comments</comments>
		<pubDate>Mon, 18 May 2009 17:22:18 +0000</pubDate>
		<dc:creator>Michael D. Irizarry</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web 2.0]]></category>

		<guid isPermaLink="false">http://www.socialvitamin.com/?p=145</guid>
		<description><![CDATA[Some useful jQuery Tips and Tricks for your everyday use. Removing and Hiding Dom Elements, Browser Detection, Toggling, Handling Select Lists and more. 1. Removing, Showing or Hiding DOM elements [...]]]></description>
			<content:encoded><![CDATA[<p>Some useful jQuery Tips and Tricks for your everyday use. Removing and Hiding Dom Elements, Browser Detection, Toggling, Handling Select Lists and more.<br />
<span id="more-145"></span></p>
<h3>1. Removing, Showing or Hiding DOM elements</h3>
<pre lang="Javascript">
// Remove Element
$("#div").remove();

// Hide
$("#div").hide();
$("#div").hide("slow");
$("#div").hide("fast");
$("#div").hide(1000);
$("#div").hide(1000, callback); 

// Show
$("#div").show();
$("#div").show("slow");
$("#div").show("fast");
$("#div").show(1000);
$("#div").show(1000, callback);  

// Toggle Hide/ Show
$("#div").toggle();
$("#div").toggle("slow");
</pre>
<h3>2. Select All Check Boxes</h3>
<pre lang="Javascript">
// Check
$("#selectList").attr('checked', true); 

// Uncheck
$("#selectList").attr('checked', false);
</pre>
<h3>3. Creating Images on the Fly</h3>
<pre lang="Javascript">
$("<img/>").attr({ "src": "images/loadingAnimation.gif" }).appendTo("#div");
</pre>
<h3>4. jQuery noConflict used when using other libraries</h3>
<pre lang="Javascript">
var $j = jQuery.noConflict();
$j('#div').hide();
</pre>
<h3>5. Getting Selected Radio Button value</h3>
<pre lang="Javascript">
$("input[name='id'][checked]").val();
</pre>
<h3>6.  Getting Select List values</h3>
<pre lang="Javascript">
// Value
$('#selectList').val(); 

// Text value
$('#selectList :selected').text() 

// Multiple Selection
var selections = [];
$('#multipleList :selected').each(function(i, selected){
     selections[i] = $(selected).text();
});
</pre>
<h3>7. Check if checkbox is Checked</h3>
<pre lang="Javascript">
$('#checkBox').attr('checked'); 

$('#checkBoxID').is(':checked'); 

$("[:checkbox]:checked").each(
    function() {
    }
);
</pre>
<h3>8. Browser Detection</h3>
<pre lang="Javascript">
if( $.browser.safari ) { // Do something }

if ($.browser.msie &#038;&#038; $.browser.version > 6 ) { // Do something }

if ($.browser.msie &#038;&#038; $.browser.version <= 6 ) { // Do something }

if ($.browser.mozilla &#038;&#038; $.browser.version >= "1.8" )  { // Do something }
</pre>
<h3>9. Highlight a Row onClick</h3>
<pre lang="Javascript">
$("tr").click(function() {
    $(this).toggleClass("rowActive");
});
</pre>
<pre lang="css">
/* CSS highlights clicked row */
.rowActive {
    border: 1px solid #333333;
    background-color: #999999;
}
</pre>
<h3>10. Building the DOM Dynamically</h3>
<pre lang="Javascript">
$("
<div/>").attr({id:"header", "class":"header"}).html("Welcome to my Site!").appendTo(document.body);
$("<img/>").attr("src", "images/logo.gif").appendTo("#header");
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.socialvitamin.com/2009/05/18/10-jquery-13-techniques-you-cant-live-without/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JS detecting event support in browsers</title>
		<link>http://www.socialvitamin.com/2009/04/03/js-detecting-event-support-in-browsers/</link>
		<comments>http://www.socialvitamin.com/2009/04/03/js-detecting-event-support-in-browsers/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 04:08:16 +0000</pubDate>
		<dc:creator>Michael D. Irizarry</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[detection]]></category>
		<category><![CDATA[events]]></category>

		<guid isPermaLink="false">http://www.socialvitamin.com/?p=86</guid>
		<description><![CDATA[As you may know there is no easy way of detecting which elements supports which events across browsers. Kangax from Perfection Kills has come up with a very clever way [...]]]></description>
			<content:encoded><![CDATA[<p>As you may know there is no easy way of detecting which elements supports which events across browsers. Kangax from <a href="http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/">Perfection Kills</a> has come up with a very clever way of detecting them.</p>
<p>JavaScript</p>
<pre lang="Javascript">

  var isEventSupported = (function(){
    var TAGNAMES = {
      'select':'input','change':'input',
      'submit':'form','reset':'form',
      'error':'img','load':'img','abort':'img'
    }
    function isEventSupported(eventName) {
      var el = document.createElement(TAGNAMES[eventName] || 'div');
      eventName = 'on' + eventName;
      var isSupported = (eventName in el);
      if (!isSupported) {
        el.setAttribute(eventName, 'return;');
        isSupported = typeof el[eventName] == 'function';
      }
      el = null;
      return isSupported;
    }
    return isEventSupported;
  })();
</pre>
<p>Use</p>
<pre lang="Javascript">
isEventSupported(<"Type of Event>")
</pre>
<p>For a more detailed description visit <a href="http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/">Kangax blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.socialvitamin.com/2009/04/03/js-detecting-event-support-in-browsers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debouncing Javascript Methods</title>
		<link>http://www.socialvitamin.com/2009/03/31/debouncing-javascript-methods/</link>
		<comments>http://www.socialvitamin.com/2009/03/31/debouncing-javascript-methods/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 03:23:58 +0000</pubDate>
		<dc:creator>Michael D. Irizarry</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[debouncing]]></category>

		<guid isPermaLink="false">http://www.socialvitamin.com/?p=58</guid>
		<description><![CDATA[What is debouncing anyways? Debouncing is any kind of hardware device or software that ensures that only a single signal will be acted upon for a single opening or closing [...]]]></description>
			<content:encoded><![CDATA[<p>What is debouncing anyways? Debouncing is any kind of hardware device or software that ensures that only a single signal will be acted upon for a single opening or closing of a contact. Imagine you have a form with a few elements that a user may access thru the tab key, on each element you have an onfocus event that will trigger an Ajax call to the server to acquire some data. You could just imagine how you could kill the server with all those Ajax calls! So that&#8217;s where debouncing comes into play. With debouncing your assuring that the method will be triggered in the element that the user intended to, although is not perfect it does work better than Throttling. <span id="more-58"></span></p>
<p>With this little method writen by John Hann from <a href="http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/">Unscriptable.com</a> you can add debouncing functionality to your JS methods.</p>
<p>Javascript</p>
<pre lang="Javascript">var debounce = function (func, threshold, execAsap) {

    var timeout;

    return function debounced () {
        var obj = this, args = arguments;
        function delayed () {
            if (!execAsap)
                func.apply(obj, args);
            timeout = null;
        };

        if (timeout)
            clearTimeout(timeout);
        else if (execAsap)
            func.apply(obj, args);

        timeout = setTimeout(delayed, threshold || 100);
    };

}</pre>
<p>Usage</p>
<pre lang="Javascript">    // using debounce in a constructor or initialization function to debounce
    // focus events for a widget (onFocus is the original handler):
    this.debouncedOnFocus = this.onFocus.debounce(500, false);
    this.inputNode.addEventListener('focus', this.debouncedOnFocus, false);</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.socialvitamin.com/2009/03/31/debouncing-javascript-methods/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
