<?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>CSSKarma &#187; ajax</title> <atom:link href="http://www.csskarma.com/blog/tag/ajax/feed/" rel="self" type="application/rss+xml" /><link>http://www.csskarma.com/blog</link> <description>display your style</description> <lastBuildDate>Tue, 31 Jan 2012 15:18:44 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>Books that made me a better designer</title><link>http://www.csskarma.com/blog/books/</link> <comments>http://www.csskarma.com/blog/books/#comments</comments> <pubDate>Fri, 07 May 2010 17:46:26 +0000</pubDate> <dc:creator>Tim</dc:creator> <category><![CDATA[Web Design]]></category> <category><![CDATA[ajax]]></category> <category><![CDATA[books]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[learning]]></category> <category><![CDATA[mobile]]></category> <category><![CDATA[sketching]]></category> <category><![CDATA[ui]]></category><guid
isPermaLink="false">http://www.csskarma.com/blog/?p=819</guid> <description><![CDATA[This is a list of books that have had a big impact on the way I design &#38; developer Web sites. A lot of the content in books now-a-days can be found on various blogs, but the books below all have something in them that I really haven&#8217;t been able to find anywhere else. Transcending [...]]]></description> <content:encoded><![CDATA[<p>This is a list of books that have had a big impact on the way I design &amp; developer Web sites. A lot of the content in books now-a-days can be found on various blogs, but the books below all have something in them that I really haven&#8217;t been able to find anywhere else.</p><div
class="book"><h3>Transcending CSS</h3><p><img
src="http://www.csskarma.com/images/transcendingcss.jpg" alt="Transcending CSS book cover" /></p><p
class="author"><a
href="http://www.stuffandnonsense.co.uk/">Andy Clarke</a></p><p
class="desc">Andy&#8217;s book is obviously very technically good and well written. I certainly got a lot of information like that out of it, but at this point you can find most of it on various blogs. My biggest take away was how Andy spoke about semantics. Specifically using IDs like &#8220;branding&#8221; and &#8220;site-info&#8221; rather than &#8220;header&#8221; and &#8220;footer&#8221;. Up to that point I had just been using &#8220;header&#8221; and &#8220;footer&#8221; because it was how it was done at the time. Andy got me thinking heavily about semantics and naming schema and also opened up a lot of doors for me to really examine how I put together a site instead of blindly do it because it&#8217;s what I&#8217;ve heard is the best.</p></div><p>&nbsp;</p><div
class="book"><h3>Bulletproof Ajax</h3><p><img
src="http://www.csskarma.com/images/bulletproofajax.jpg" alt="Bulletproof Ajax book cover" /></p><p
class="author"><a
href="http://adactio.com/">Jeremy Keith</a></p><p
class="desc">I read this book right around the time I began playing with <a
href="http://jquery.com">jQuery</a> and it made me realize that, however great a library like jQuery may be, it won&#8217;t be around forever and if I don&#8217;t learn how it really works, I&#8217;ll be screwed when it finally disappears like so many other Web technologies. In <em>Bulletproof Ajax</em> I learned how exactly the XMLHTTPRequest worked, what jQuery was doing, and how it made it so easy to work with, all while keeping Web standards in sight and never putting something together that couldn&#8217;t function without JavaScript.</p></div><p>&nbsp;</p><div
class="book"><h3>101 Things I Learned in Architecture School</h3><p><img
src="http://www.csskarma.com/images/101things.jpg" alt="101 Things I Learned in Architecture School book cover" /></p><p
class="author"><a
href="http://www.frederickdesignstudio.com/">Matthew Frederick</a></p><p
class="desc">Drawing lines seems like a stupid thing to want to learn, but that&#8217;s what this book effectively taught me. I learned the importance of some very basic design principles and how to effectively communicate those ideas to others through certain shapes and sketching techniques. <strong>This is a great book</strong>. I really got into it after a talk by <a
href="http://www.lukew.com/">Luke Wroblewski</a> at the Web App Summit in Newport Beach.</p></div><p>&nbsp;</p><div
class="book"><h3>Mobile Web Design</h3><p><img
src="http://www.csskarma.com/images/mobilewebdesign.jpg" alt="Mobile Web Design book cover" /></p><p
class="author"><a
href="http://cameronmoll.tumblr.com/">Cameron Moll</a></p><p
class="desc">The first book to really spark my interest in the Mobile Web. Ever since reading it I&#8217;ve felt like I have a slight edge whenever beginning a project with mobile requirements. Most mobile books now focus on intense graphics and acceleration of devices like the iPhone. In <em>Mobile Web Design</em>, Cameron talks about a plethora of devices and focuses on Web standards rather than cool things you can do.</p></div><p>Obviously, I highly recommend all those these books, as they&#8217;ve had a pretty large impact on me as a designer &amp; a developer. The best part about them is that they&#8217;re all pretty easy reads, they&#8217;re not the kind of books you have to spend a week or 2 reading.</p><p>Does anyone else have books like this? Or do we all just read blogs now?</p> ]]></content:encoded> <wfw:commentRss>http://www.csskarma.com/blog/books/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Selectable RSS with SimplePie and jQuery</title><link>http://www.csskarma.com/blog/selectable-rss/</link> <comments>http://www.csskarma.com/blog/selectable-rss/#comments</comments> <pubDate>Mon, 17 Aug 2009 05:45:45 +0000</pubDate> <dc:creator>Tim</dc:creator> <category><![CDATA[Web Development]]></category> <category><![CDATA[advanced]]></category> <category><![CDATA[ajax]]></category> <category><![CDATA[rss]]></category> <category><![CDATA[simplepie]]></category> <category><![CDATA[ui]]></category><guid
isPermaLink="false">http://www.csskarma.com/blog/?p=632</guid> <description><![CDATA[I was building an RSS reader for a project last week and it turned out to be a cool little app. So I thought I&#8217;d share some of the code. View demo Download demo files Let&#8217;s start off with the HTML we need to get some user interaction with the form. It&#8217;s a pretty basic, [...]]]></description> <content:encoded><![CDATA[<p><img
src="http://www.csskarma.com/images/articles/simplepieloader.jpg" alt="banner" /></p><p>I was building an RSS reader for a project last week and it turned out to be a cool little app. So I thought I&#8217;d share some of the code.</p><p
class="demo"><a
href="http://www.csskarma.com/articles/examples/simplepieloader/">View demo</a></p><p
class="demo"><a
href="http://www.csskarma.com/articles/examples/simplepieloader/simplepieloader.zip">Download demo files</a></p><p>Let&#8217;s start off with the HTML we need to get some user interaction with the form. It&#8217;s a pretty basic, just some of checkboxes.</p><p><img
src="http://www.csskarma.com/images/articles/simplepie_form.png" alt="form with 4 checkboxes" /></p><h5>HTML</h5><pre><code>&lt;form action="" method="post" id="selection"&gt;
  &lt;h2&gt;Choose your news sources&lt;/h2&gt;
 <span>&lt;!--
  Setting all the checkbox names to "source[] helps us build the array on submit"
  We're also adding the RSS feed url to the checkbox value so we can save it in the array values
  --&gt;</span>
  &lt;ul&gt;
  &lt;li&gt;&lt;input type="checkbox" id="csskarma" name="source[]" value="http://www.csskarma.com/blog/feed/"/&gt;&lt;label for="csskarma"&gt;CSSKarma&lt;/label&gt;&lt;/li&gt;
  &lt;li&gt;&lt;input type="checkbox" id="cnn" name="source[]" value="http://rss.cnn.com/rss/cnn_topstories.rss"/&gt;&lt;label for="cnn"&gt;CNN&lt;/label&gt;&lt;/li&gt;
  &lt;li&gt;&lt;input type="checkbox" id="espn" name="source[]" value="http://sports-ak.espn.go.com/espn/rss/news"/&gt;&lt;label for="espn"&gt;ESPN&lt;/label&gt;&lt;/li&gt;
  &lt;li&gt;&lt;input type="checkbox" id="vitamin" name="source[]" value="http://feeds.feedburner.com/vitaminmasterfeed"/&gt;&lt;label for="vitamin"&gt;Think Vitamin&lt;/label&gt;&lt;/li&gt;
  &lt;/ul&gt;

  <span>&lt;!-- Setting the submit name to "btn" --&gt;</span>
  &lt;input type="submit" value="submit" name="btn" id="btn-submit"/&gt;
  &lt;/form&gt;
  &lt;/div&gt;&lt;!--/#selectnews--&gt;</code></pre><p>The only real thing worth noting in the form code are the names of the checkboxes. We use all the same name to group them together and the [ ] helps create the array on submit. I just chose to use <code>source[]</code> because it made sense to me, but you can use anything as long as the names are consistent and the brackets are there. Just adjust your PHP accordingly.</p><h5>SimplePie PHP</h5><pre><code>&lt;?php
<span>/* Get the SimplePie library */</span>
require_once ('inc/simplepie.inc');

<span>/* Create a new instance of SimplePie */</span>
$feed = new SimplePie();

<span>/* Get array */</span>
<span>// If the form has been submitted and the user selected news sources</span>
if (isset ($_POST['btn']) &amp;&amp; isset($_POST['source'])) {

    <span>// Save the array of news sources to a variable $checked</span>
    $checked = $_POST['source'];

    <span>// Pass the array of news sources through the SimplePie set_feed_url() function</span>
    $feed-&gt;set_feed_url($checked);

    <span>// Also, save this data to a cookie called "feedurls" that will expire when the browser closes</span>
    setcookie('feedurls', serialize($checked));

<span>// If the form wasn't submitted look for the "feedurls" cookie</span>
} else if (isset ($_COOKIE['feedurls'])) {

	<span>// If the cookie was found, pass the data through set_feed_urls()</span>
	$feed-&gt;set_feed_url(unserialize($_COOKIE['feedurls']));
}

<span>/* Set item limit */</span>
$feed-&gt;set_item_limit(3);

<span>/* Enable caching */</span>
$feed-&gt;enable_cache(true);

<span>/* Provide the caching folder */</span>
$feed-&gt;set_cache_location('cache');

<span>/* Set the amount of seconds you want to cache the feed */</span>
$feed-&gt;set_cache_duration(1800);

<span>/* I don't know what "init" means */</span>
$feed-&gt;init();

<span>/* Handle the content type (atom, RSS...) */</span>
$feed-&gt;handle_content_type();
?&gt;</code></pre><p>This is nothing that can&#8217;t be read in the comments, but the guts of the PHP comes in right under the &#8220;Get Array&#8221; comment. We&#8217;re checking to see if the form was submitted and the user selected news sources; if so, dump the values into SimplePie and save them to a cookie we can refer to later. The initial idea was for this to live at a pretty open place (a computer lab or something), that&#8217;s why the cookie expires on browser close.</p><p>I limited the per-feed output to 3 to keep it a little clean, but you can set that to whatever you want. It&#8217;d be pretty easy to let the user choose this as well with a select menu:</p><pre><code>&lt;select name="displayNumber"&gt;
&lt;option value="1"&gt;1&lt;/option&gt;
&lt;option value="2"&gt;2&lt;/option&gt;
&lt;option value="3"&gt;3&lt;/option&gt;
&lt;/select&gt;</code></pre><p>And replace <code>$feed-&gt;set_item_limit(3);</code> with <code>$feed-&gt;set_item_limit($_POST['displayNumber']);</code>. There may be some extra tweaking beyond that, but the general idea is to pass the submitted value into SimplePie.</p><h5>jQuery</h5><p>Now that we have the form fully functional we can layer some JavaScript on top of it to make it a little more <em>nifty</em>. This is using the <a
rel="external" href="http://malsup.com/jquery/form/">jQuery Form Plugin</a>. It&#8217;s the first time I&#8217;ve really used this plugin, but it&#8217;s actually pretty nice and easy to use. I had some little quirks with it, but nothing too major.</p><pre><code>$(function() {

<span>/* If JavaScript is active create a link to slide the form out */</span>
$('#getform a').click(function(){
	$('#selection').slideToggle('slow');
	return false;
});<span>//</span>

<span>/* make it look like something happened */</span>
$('#selection, #reader').hide(); <span>//</span>
$('#reader').fadeIn('slow'); <span>//</span>

<span> /* bind form using 'ajaxForm' */</span>
$('#selection').ajaxForm(options); 

<span>/* Submit form via Ajax */</span>
var options = {
    target:       '#rssloader',
}; <span>//</span>

});<span>// End jQuery</span></code></pre><p
class="demo"><a
href="http://www.csskarma.com/articles/examples/simplepieloader/">View demo</a></p><p
class="demo"><a
href="http://www.csskarma.com/articles/examples/simplepieloader/simplepieloader.zip">Download demo files</a></p><p>Anyway, that&#8217;s all I have for today. It&#8217;s a pretty unpolished demo so let me know what you think, where I screwed up and if you can build on it and make it better. I&#8217;ll try to write some more soon.</p><h5>Ingredient list</h5><ul><li><a
rel="external" href="http://simplepie.org/downloads/">SimplePie</a></li><li><a
rel="external" href="http://css-tricks.com/video-screencasts/55-adding-rss-content-with-simplepie/">Starter files from CSS-Tricks</a></li><li><a
rel="external" href="http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.3.2.min.js&amp;downloadBtn=">jQuery</a></li><li><a
rel="external" href="http://malsup.com/jquery/form/">jQuery Form Plugin</a></li><li><a
href="http://sharkcool.net" rel="external">Hill&#8217;s Brain</a></li><li>Coffee</li></ul> ]]></content:encoded> <wfw:commentRss>http://www.csskarma.com/blog/selectable-rss/feed/</wfw:commentRss> <slash:comments>8</slash:comments> </item> <item><title>Cracking open Google Gadgets</title><link>http://www.csskarma.com/blog/cracking-open-google-gadgets/</link> <comments>http://www.csskarma.com/blog/cracking-open-google-gadgets/#comments</comments> <pubDate>Mon, 14 Apr 2008 18:05:50 +0000</pubDate> <dc:creator>Tim</dc:creator> <category><![CDATA[Web Development]]></category> <category><![CDATA[ajax]]></category> <category><![CDATA[google gadgets]]></category> <category><![CDATA[google gears]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[rss]]></category> <category><![CDATA[widget]]></category> <category><![CDATA[xml]]></category><guid
isPermaLink="false">http://www.csskarma.com/blog/?p=60</guid> <description><![CDATA[A few weeks ago, I decided to do a little research into Google Desktop. Which is basically a Google widget platform competing with Yahoo! widgets. After some exploration and dissecting Google Gadgets, this is what I came out with: The core of the application runs on 2 files main.js main.xml There are also some image [...]]]></description> <content:encoded><![CDATA[<p>A few weeks ago, I decided to do a little research into <a
href="http://www.google.com/ig/directory?synd=open" rel="external">Google Desktop</a>. Which is basically a Google widget platform competing with <a
href="http://widgets.yahoo.com/" rel="external">Yahoo! widgets</a>. After some exploration and dissecting Google Gadgets, this is what I came out with:</p><ul><li>The core of the application runs on 2 files<ul><li>main.js</li><li>main.xml</li></ul></li><li>There are also some image and CSS options readily available, but the guts of it really run on JavaScript and XML</li><li>Overall, it&#8217;s very straightforward, a little playing around with the sample gadgets will give you a good idea of what you can do (endless possibilites)</li></ul><p>The file structure of  some of the sample gadgets leaves a lot of room for improvement. Some seem to be built to handle very large, modular applications, but in most cases, they&#8217;re a little too modular (in my opinion).</p><p>Some of the more useful samples you can go through are:</p><ul><li>Animations</li><li>ComboBox</li><li>Countdown</li><li>DragDrop</li><li>HelloWorld</li><li>HTMLDetailsView</li><li>QueryAPI</li><li>RSS</li><li>XMLDetailsView</li><li>XMLHttpRequest</li></ul><p>There are others too, but these are the one&#8217;s I found most useful. So, lookin at those options, a being an RSS freak, I chose to customize the RSS gadget for CSSKarma</p><p><strong>CSSKarma RSS Gadget</strong></p><p><a
href="http://www.csskarma.com/gadgets/rss/csskarma_rss.gg">Download CSSKarma RSS Gadget</a></p><p>The first thing to do is to make a copy of the RSS sample given with the Google Gadget samples. I did that (as a CSS person), I opened up the theme folder &#8220;default&#8221; and looked for &#8220;details.css&#8221;. I assumed this file would edit all the presentation for the gadget. It doesn&#8217;t. I only edits the flyout menu (after you click on a link in the RSS gadget). OK, that&#8217;s fine. So I enter this CSS:</p><pre><code>body {
  color:#323F4C;
  background:#fff url(http://www.csskarma.com/images/bg_branding.jpg) no-repeat 0 bottom;
  font: 0.8em/1.5 Verdana, Arial, Sans-serif;
}</code></pre><p>That will add my CSSKarma logo to the flyout and add some basic CSS. The other files in the theme folder to deal with are &#8220;entry_item.xml&#8221;, &#8220;theme_config.xml&#8221; and &#8220;title.xml&#8221;. After you look at  &#8220;theme_config.xml&#8221; and &#8220;title.xml&#8221;, you&#8217;ll see why I think this is a little <em>too</em> modular.  I left those two file alone. But I did edit &#8220;entry_item.xml&#8221;, view <a
href="http://www.csskarma.com/gadgets/rss/entry_item.xml">entry_item.xml</a>. I edited some style information in there (one more thing I&#8217;m not thrilled about &#8211; embedding style info into the XML).</p><p>The next folder to tackle is  &#8220;editme&#8221;. It contains 2 files (config_constants.js and entry_item_impl.js). In &#8220;entry_item_impl.js&#8221; you can edit the RSS nodes, if you want. I chose not to. In &#8220;config_constants.js&#8221; you need to edit the URL of the RSS feed you want to use.</p><p>The last thing I wanted to do was to remove the default background image from &#8220;main.xml&#8221;. When I did this, the background was transparent, by default. So in &#8220;main.xml&#8221; I added a background attribute of #FFFFFF to top level div (container). I also edited the height and width attributes of the &#8220;view&#8221; element for when the gadget is undocked from Google Desktop.</p><p>The outcome of this was the <a
href="http://www.csskarma.com/gadgets/rss/csskarma_rss.gg">CSSKarma RSS Gadget</a> (You&#8217;ll probably need Google Desktop installed to use this). A very basic RSS gadget made by making simple modifications to the sample files. Feel free to download, play around with it, and let me know about any errors you find.</p><p><strong>Aptana Jaxter</strong></p><p><a
href="http://www.aptana.com/" rel="external">Aptana Jaxter</a> recently released &#8220;The worlds first Ajax server&#8221; (I have no date to back up the claim that it was recent). I&#8217;ve seen some web apps using this in integrating the Google API, looks promising but there&#8217;s very limited server space right now. I&#8217;d like to see how these can be integrated into the <a
href="http://code.google.com/apis/gears/mobile.html" title="http://code.google.com/apis/gears/mobile.html"  rel="external">Mobile web</a>. I don&#8217;t have too much information on it right now (and I keep losing the damn link).</p><p>That&#8217;s all I have for now.</p><p>With ease<br/>Tim</p> ]]></content:encoded> <wfw:commentRss>http://www.csskarma.com/blog/cracking-open-google-gadgets/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 5/14 queries in 0.051 seconds using disk: basic

Served from: www.csskarma.com @ 2012-02-09 15:50:44 -->
