<?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>Design Magazine &#187; javascript</title>
	<atom:link href="http://designmagazine.us/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://designmagazine.us</link>
	<description></description>
	<lastBuildDate>Wed, 22 Feb 2012 03:21:10 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Win $300 Worth of PSD to HTML From PSD2HTML (x4)</title>
		<link>http://designmagazine.us/win-300-worth-of-psd-to-html-from-psd2html-x4/</link>
		<comments>http://designmagazine.us/win-300-worth-of-psd-to-html-from-psd2html-x4/#comments</comments>
		<pubDate>Tue, 21 Feb 2012 17:45:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[designer]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[psd]]></category>
		<category><![CDATA[ui]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[year]]></category>
		<category><![CDATA[contests]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[friends]]></category>
		<category><![CDATA[sponsored]]></category>

		<guid isPermaLink="false">http://designmagazine.us/win-300-worth-of-psd-to-html-from-psd2html-x4/</guid>
		<description><![CDATA[ If you’re a graphic or web designer by trade, chances are coding a website isn’t something that you prefer to spend your time on. That’s why many designers get frustrated when tasked with having to design and code a site by themselves. Today, our friends at PSD2HTML are coming to the rescue by offering 4 lucky Psdtuts readers $300 worth of services for free . ]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p> If you’re a graphic or web designer by trade, chances are coding a website isn’t something that you prefer to spend your time on. That’s why many designers get frustrated when tasked with having to design and code a site by themselves. Today, our friends at PSD2HTML are coming to the rescue by offering 4 lucky Psdtuts readers $300 worth of services for free . </p>
<p><a href="http://designmagazine.us?goto=c36842cc7de25a544b7dbc793f0c2d21" target="_blank" rel="nofollow"><img src="http://rss.buysellads.com/img.php?z=1260585&#038;k=60af7cbe8eb4872370ddd01db766439b&#038;a=15869&#038;c=494629099" border="0" alt=" in "  /></a>
<p>If you’re a graphic or web designer by trade, chances are coding a website isn’t something that you prefer to spend your time on. That’s why many designers get frustrated when tasked with having to design and code a site by themselves. Today, our friends at <a href="http://designmagazine.us?goto=dc1681db4fa752b23815acb7a731dda6" rel="nofollow">PSD2HTML</a> are coming to the rescue by offering <strong>4 lucky Psdtuts readers $300 worth of services for free</strong>. To enter, all you have to do is submit your entry using the form below.</p>
<p><span></span></p>
<p>PSD2HTML is a service that provides fast, high quality conversion of graphic web designs to HTML. They accept source files in all common formats including PSD, PNG, AI and even existing HTML markup.</p>
<p>The turnaround time depends on the number of pages and the required functionality, but the conversion of the first HTML page usually takes 8 business hours. Expedited delivery is available as well.</p>
<p>If you need more complex PSD to HTML slicing, you can select among the variety of markup, layout and JavaScript options until you come up with something that fully suits your needs. With over 7 years of experience, PSD2HTML can handle any conversion or implementation tasks, whether it&#8217;s web page, email, or mobile template!</p>
<h2>PSD2HTML has launched Monthly Deals!</h2>
<p>Now you have a chance to get discounts on most popular options each month. This month&#8217;s deal comes handy for those who&#8217;d like to have their websites compatible with most popular native browsers on the following mobile platforms: iPhone, iPad and Android 2.2+, BlackBerry 6+. Stay tuned for more updates from PSD2HTML!</p>
<p><strong>What they offer:</strong></p>
<ul>
<li>Hand-coded W3C valid table-less SEO semantic and fast loading XHTML / CSS or HTML5 / CSS3 markup.</li>
<li>High-level CMS implementation, including WordDress, Drupal, Joomla, Magento etc.</li>
<li>Compatibility with all popular browsers: Internet Explorer 7+, Firefox 3.6+, Google Chrome, Safari 5+ and Opera 11+.</li>
<li>Quality email templates compatible with: MS Outlook 2003+, Outlook Express, Apple Mail, and other email clients. </li>
<li>Mobile templates compatible with iOS, Android, BlackBerry, etc.</li>
</ul>
<p>For more details about the quality service they provide check out their <a href="http://designmagazine.us?goto=ac3e7ab0fda028a52186611bb5f938f3" rel="nofollow">examples</a> page and what their clients have to say. </p>
<div>
<h4><a href="http://designmagazine.us?goto=15ea048b0b79c04caf43c2b5c0cf4afa" rel="nofollow">Submit Your Entry</a></h4>
</div>
<div><a href="http://designmagazine.us?goto=dc1681db4fa752b23815acb7a731dda6" rel="nofollow"><img src="http://d2f8dzk2mhcqts.cloudfront.net/Giveaway_2012_02_Psd2html/home-600x500.jpg" width="600" height="500" border="0" alt="Home-600x500 in " /></a></div>
<hr />
<h2>Up for Grabs</h2>
<ul>
<li>$300 worth of PSD2HTML services (x4).</li>
</ul>
<hr />
<h2>Rules</h2>
<ul>
<li>To enter, submit your entry using the form above.</li>
<li>You may only enter once.</li>
<li>Follow PSD2HTML on <a href="http://designmagazine.us?goto=23115c72f1ce12c2e97e114a01e707ec" rel="nofollow">Twitter</a> or <a href="http://designmagazine.us?goto=bdaa933852d3bce73f375fe0709f7ae9" rel="nofollow">Facebook</a> (optional).</li>
<li>Make sure to enter a valid email address so that we can contact you.</li>
<li>Entries will be accepted until Friday, February 24, 2012 at 11:59 PM, EST.</li>
</ul>
<p><em>This giveaway was sponsored by Psd2html.</em></p>
<p><a href="http://designmagazine.us?goto=bd49f05419f38ddd3fcd33ebdf6b8197" rel="nofollow"><img src="http://feedads.g.doubleclick.net/~a/B0H60qXGBSyvUvWxz7q214gY-1Q/0/di" border="0" ismap="true" alt=" in " /></img></a><br/><br />
<a href="http://designmagazine.us?goto=33e06cc044334553e3bf2e76f1ac45f8" rel="nofollow"><img src="http://feedads.g.doubleclick.net/~a/B0H60qXGBSyvUvWxz7q214gY-1Q/1/di" border="0" ismap="true" alt=" in " /></img></a></p>
<div>
<a href="http://designmagazine.us?goto=945dc8b08e5a613cf970c4090b122161" rel="nofollow"><img src="http://feeds.feedburner.com/~ff/psdtuts?d=yIl2AUoC8zA" border="0" alt=" in " /></img></a> <a href="http://designmagazine.us?goto=0dde149508a4ed397b3882fa7ec3d18e" rel="nofollow"><img src="http://feeds.feedburner.com/~ff/psdtuts?i=EvONp640zxg:xlXnMEbPEFM:V_sGLiPBpWU" border="0" alt=" in " /></img></a> <a href="http://designmagazine.us?goto=3ae710a86fcc0a4b0c99e97d45f683d6" rel="nofollow"><img src="http://feeds.feedburner.com/~ff/psdtuts?i=EvONp640zxg:xlXnMEbPEFM:gIN9vFwOqvQ" border="0" alt=" in " /></img></a> <a href="http://designmagazine.us?goto=d0e7e0f0526d22520e5d83b4aa76f2d1" rel="nofollow"><img src="http://feeds.feedburner.com/~ff/psdtuts?d=TzevzKxY174" border="0" alt=" in " /></img></a>
</div>
<p><img src="http://feeds.feedburner.com/~r/psdtuts/~4/EvONp640zxg" height="1" width="1" alt=" in " /></p>
<p> If you’re a graphic or web designer by trade, chances are coding a website isn’t something that you prefer to spend your time on. That’s why many designers get frustrated when tasked with having to design and code a site by themselves. Today, our friends at PSD2HTML are coming to the rescue by offering 4 lucky Psdtuts readers $300 worth of services for free . </p>
<p>Artica Source: <a href="http://designmagazine.us?goto=94a4a861862f372371bcf4a957dafac0"target="_blank"  title="Win $300 Worth of PSD to HTML From PSD2HTML (x4)" rel="nofollow">Win $300 Worth of PSD to HTML From PSD2HTML (x4)</a></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://designmagazine.us/win-300-worth-of-psd-to-html-from-psd2html-x4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Twitter Bootstrap 2: Bootstrap Goes Responsive</title>
		<link>http://designmagazine.us/twitter-bootstrap-2-bootstrap-goes-responsive/</link>
		<comments>http://designmagazine.us/twitter-bootstrap-2-bootstrap-goes-responsive/#comments</comments>
		<pubDate>Wed, 15 Feb 2012 06:00:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[links]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[responsive]]></category>
		<category><![CDATA[techniques]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[ui]]></category>
		<category><![CDATA[wide]]></category>
		<category><![CDATA[wp]]></category>
		<category><![CDATA[media]]></category>
		<category><![CDATA[navigation]]></category>
		<category><![CDATA[result]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://designmagazine.us/twitter-bootstrap-2-bootstrap-goes-responsive/</guid>
		<description><![CDATA[ Recently, we published a piece titled 5 Incredibly Useful Tools Built Into Twitter Bootstrap , which took a look at the basic structure of Twitter&#8217;s Bootstrap framework and walked you through implementing some of the major components. Twitter just released Bootstrap 2.0 , an update so large it equates to a near full rewrite]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p> Recently, we published a piece titled 5 Incredibly Useful Tools Built Into Twitter Bootstrap , which took a look at the basic structure of Twitter&#8217;s Bootstrap framework and walked you through implementing some of the major components. Twitter just released Bootstrap 2.0 , an update so large it equates to a near full rewrite</p>
<p></p>
<div><img class="alignNone size-full wp-image-1611" src="http://designshack.co.uk/wp-content/uploads/bootstrap2-4.jpg" alt="Bootstrap2-4 in " width="510" /></div>
<p>Recently, we published a piece titled <a href="http://designmagazine.us?goto=de151be8d4e4e9ed1cfb1f463b60a11a"rel="nofollow" target="_blank" >5 Incredibly Useful Tools Built Into Twitter Bootstrap</a>, which took a look at the basic structure of Twitter&#8217;s Bootstrap framework and walked you through implementing some of the major components.</p>
<p>Twitter just released <a href="http://designmagazine.us?goto=2d64edefcb433261b985e3c7cbe3dc12"rel="nofollow" target="_blank" >Bootstrap 2.0</a>, an update so large it equates to a near full rewrite. There are quite a few new features and toys to play with, but the real headliner is that the framework is now fully responsive. Join us as we dig in to see how the new grid works and what other cool new features have been added. You&#8217;ll learn how to implement Bootstrap in your projects and will also pick up some extremely handy CSS techniques that you can use anywhere. </p>
<p><span></span><br />
<em>Like the article? Be sure to subscribe to our <a href="http://designmagazine.us?goto=8ab82af6ff52e376bde20ec73502d4ba"rel="nofollow">RSS feed</a> and follow us on <a rel="nofollow" target="_blank" >Twitter</a> to stay up on recent content.</em></p>
<h2>Demo</h2>
<p>We&#8217;ll be talking about several new Bootstrap features today. If you want to see them in action, stop by the live demo below.</p>
<p><strong>Demo:</strong> <a href="http://designmagazine.us?goto=57118448f2faf361a0c7bfd947afa35e"rel="nofollow" target="_blank" >Click here</a> to launch.</p>
<div><a href="http://designmagazine.us?goto=57118448f2faf361a0c7bfd947afa35e"rel="nofollow" target="_blank" ><img class="alignNone size-full wp-image-1611" src="http://designshack.co.uk/wp-content/uploads/bootstrap2-11.jpg" alt="Bootstrap2-11 in " width="510" /></a></div>
<h2>Implementing the Responsive Grid</h2>
<p>The most major aspect of Twitter Bootstrap is of course that it is now fully responsive. If you&#8217;re still labeling the whole responsive movement as a silly fad in hopes that you can ultimately skip learning the requisite techniques, you&#8217;re out of luck. Responsive design is well on its way to being a standard practice instead of a &#8220;nice to have&#8221; add on. It&#8217;s really not as complicated as you might think and tools like Bootstrap make it even easier. </p>
<p>The new responsive grid is twelve columns wide and works much like the sixteen column grid from Bootstrap 1. If you&#8217;ve ever used <em>any</em> grid system before, then you&#8217;ll feel right at home as there&#8217;s nothing too Earth shattering here. </p>
<div><img class="alignNone size-full wp-image-1611" src="http://designshack.co.uk/wp-content/uploads/bootstrap2-1.jpg" alt="Bootstrap2-1 in " width="510" /></div>
<p>To implement the grid, you pretty much follow the same steps as you always did. Start with a container div, then create a row and fill that row with span(x) divs. Given that it&#8217;s a twelve column grid, just make sure the numbers in a row add up to twelve. Try four &#8220;span3&#8243; divs, a &#8220;span9&#8243; with a &#8220;span3&#8243; or even just a straight up &#8220;span12&#8243; to go all the way across. Here&#8217;s a quick example:</p>
<div>
<div>
<div>
<pre><span><<span>div</span> <span>class</span><span>=</span><span>"container"</span>></span>
  <span><<span>div</span> <span>class</span><span>=</span><span>"row"</span>></span>
    <span><<span>div</span> <span>class</span><span>=</span><span>"span4"</span>><<span>p</span>></span>Lorem ipsum dolor sit amet<span><<span>/</span><span>p</span>><<span>/</span><span>div</span>></span>
    <span><<span>div</span> <span>class</span><span>=</span><span>"span4"</span>><<span>p</span>></span>Lorem ipsum dolor sit amet<span><<span>/</span><span>p</span>><<span>/</span><span>div</span>></span>
    <span><<span>div</span> <span>class</span><span>=</span><span>"span4"</span>><<span>p</span>></span>Lorem ipsum dolor sit amet<span><<span>/</span><span>p</span>><<span>/</span><span>div</span>></span>
  <span><<span>/</span><span>div</span>></span>
<span><<span>/</span><span>div</span>></span></pre>
</div>
</div>
</div>
<p></ br></p>
<p>The above represents a static grid. It will still be responsive, it just won&#8217;t respond to every minute browser window size change, only those set by media queries. If you want a fluid grid, use the fluid classes:</p>
<div>
<div>
<div>
<pre><span><<span>div</span> <span>class</span><span>=</span><span>"container-fluid"</span>></span>
  <span><<span>div</span> <span>class</span><span>=</span><span>"row-fluid"</span>></span>
    <span><<span>div</span> <span>class</span><span>=</span><span>"span4"</span>><<span>p</span>></span>Lorem ipsum dolor sit amet<span><<span>/</span><span>p</span>><<span>/</span><span>div</span>></span>
    <span><<span>div</span> <span>class</span><span>=</span><span>"span4"</span>><<span>p</span>></span>Lorem ipsum dolor sit amet<span><<span>/</span><span>p</span>><<span>/</span><span>div</span>></span>
    <span><<span>div</span> <span>class</span><span>=</span><span>"span4"</span>><<span>p</span>></span>Lorem ipsum dolor sit amet<span><<span>/</span><span>p</span>><<span>/</span><span>div</span>></span>
  <span><<span>/</span><span>div</span>></span>
<span><<span>/</span><span>div</span>></span></pre>
</div>
</div>
</div>
<p></ br></p>
<h2>The Media Queries</h2>
<p>The included media queries are listed below, starting at mobile and working their way up. Basically, each one goes in and changes the size of the columns to reflow the layout to something more appropriate for the viewport.</p>
<ul>
<li>@media (max-width: 480px)</li>
<li>@media (max-width: 768px)</li>
<li>@media (min-width: 768px) and (max-width: 980px)</li>
<li>@media (max-width: 980px)</li>
<li>@media (min-width: 980px)</li>
<li>@media (min-width: 1200px)</li>
</ul>
<p>The first media query (480px and below) targets smartphones and pretty much breaks everything down to a single, 100% width column. This may be a bit oversimplified for your tastes, but the beauty of frameworks like this is that they&#8217;re only suggestions, you&#8217;re encouraged to customize to your heart&#8217;s content.</p>
<p>The next media query targets portrait tablets with a range of 480px to 768px, then up to 980px for landscape tablets and on up to standard desktops and large displays.</p>
<p>For the static grid, individual columns start at 70px wide, then jump down to 60px and finally down to 42px before going 100% width for mobile. </p>
<div><img class="alignNone size-full wp-image-1611" src="http://designshack.co.uk/wp-content/uploads/bootstrap2-2.jpg" alt="Bootstrap2-2 in " width="510" /></div>
<p><strong>Tip: Grab the Right Download</strong><br />
Interestingly enough, the media queries aren&#8217;t included in the default download from the Bootstrap homepage. If you want them, you&#8217;ll have to grab the <a href="http://designmagazine.us?goto=b534998222170a327d4f1fa908eb0e86"rel="nofollow" target="_blank" >GitHub Download</a>.</p>
<h2>Nice Attribute Value Selector Usage</h2>
<p>If you check out the code for the media queries, you might learn a neat trick or two. For instance, the devs have implemented a solid example of the &#8220;Arbitrary Substring Attribute Value Selector&#8221;, which I wrote about in <a href="http://designmagazine.us?goto=37c4392c0b6878604d75a1052f8b3ec9"rel="nofollow" target="_blank" >CSS Selectors: Just the Tricky Bits</a>.</p>
<div><img class="alignNone size-full wp-image-1611" src="http://designshack.co.uk/wp-content/uploads/bootstrap2-3.jpg" alt="Bootstrap2-3 in " width="510" /></div>
<p>Bootstrap has many classes that use the word &#8220;span&#8221; (span1, span2, etc.), and rather than typing out each individually, the ASAVS grabs them all in one go with this fancy bit of code: [class*="span"]. This selector actually digs through the HTML and finds anything with &#8220;span&#8221; in the class name, regardless of what follows it. Even a class of &#8220;spansomethingtotallycrazy&#8221; would be targeted. </p>
<h2>Content Transformation</h2>
<p>Though the heart of the media queries is to reflow the columns, there&#8217;s a lot more going on here as well. The developers have actually taken the time to restructure many of the elements so that they transform as the viewport size changes. </p>
<p>For instance, the navigation menus change pretty drastically when you&#8217;re viewing on a tablet or smartphone. To see an example, test out the <a href="http://designmagazine.us?goto=2d64edefcb433261b985e3c7cbe3dc12"rel="nofollow" target="_blank" >Bootstrap Homepage</a>. At full size, the navigation menu is a simple horizontal list of text links.</p>
<div><img class="alignNone size-full wp-image-1611" src="http://designshack.co.uk/wp-content/uploads/bootstrap2-4.jpg" alt="Bootstrap2-4 in " width="510" /></div>
<p>On a tablet or smartphone though, the text is cleared out and replaced with a button up in the top right of the screen.</p>
<div><img class="alignNone size-full wp-image-1611" src="http://designshack.co.uk/wp-content/uploads/bootstrap2-5.jpg" alt="Bootstrap2-5 in " width="510" /></div>
<p>Tapping on the button will expand the new menu area. Here we have a vertical list of links, which allows for larger tappable areas. </p>
<div><img class="alignNone size-full wp-image-1611" src="http://designshack.co.uk/wp-content/uploads/bootstrap2-6.jpg" alt="Bootstrap2-6 in " width="510" /></div>
<h3>Responsive Images</h3>
<div><img class="alignNone size-full wp-image-1611" src="http://designshack.co.uk/wp-content/uploads/bootstrap2-7.jpg" alt="Bootstrap2-7 in " width="510" /></div>
<p>The navigation menu isn&#8217;t the only thing that changes size with the viewports, lots of other objects do as well, from simple buttons up to more complicated objects like image carousels. To pull off the automatically resizing images, Twitter has taken the &#8220;max-width: 100%;&#8221; route. Here&#8217;s the full snippet:</p>
<div>
<div>
<div>
<pre>img <span>{</span>
  <span>max-width</span><span>:</span> <span>100%</span><span>;</span>
  <span>height</span><span>:</span> <span>auto</span><span>;</span>
  <span>border</span><span>:</span> <span>0</span><span>;</span>
  -ms-interpolation-mode<span>:</span> bicubic<span>;</span>
<span>}</span></pre>
</div>
</div>
</div>
<p></ br></p>
<p>This makes it so that, as those columns and rows resize themselves, the image width will max out at the width of the parent column. Also notice the &#8220;-ms-interpolation-mode: bicubic;&#8221; line. This is a fairly obscure property that essentially makes image re-sizing smoother in IE. </p>
<h2>More New Stuff</h2>
<p>The responsive functionality is definitely the coolest new feature of Bootstrap, but there&#8217;s a lot more here to get excited about. Here are three of my favorite items:</p>
<h3>Progress Bars</h3>
<div><img class="alignNone size-full wp-image-1611" src="http://designshack.co.uk/wp-content/uploads/bootstrap2-8.jpg" alt="Bootstrap2-8 in " width="510" /></div>
<p>Bootstrap now has cross-browser-compatible progress bars that are super easy to implement. Just insert a snippet like the one below:</p>
<div>
<div>
<div>
<pre><span><<span>div</span> <span>class</span><span>=</span><span>"progress"</span>></span>
  <span><<span>div</span> <span>class</span><span>=</span><span>"bar"</span> <span>style</span><span>=</span><span>"width: 30%;"</span>><<span>/</span><span>div</span>></span>
<span><<span>/</span><span>div</span>></span></pre>
</div>
</div>
</div>
<p></ br></p>
<p>The &#8220;width: 30%&#8221; here resembles how far along the progress bar will be. If you want to change that to half full, just type in 50%. </p>
<h3>Button Groups</h3>
<div><img class="alignNone size-full wp-image-1611" src="http://designshack.co.uk/wp-content/uploads/bootstrap2-9.jpg" alt="Bootstrap2-9 in " width="510" /></div>
<p>Button groups are a bit like breadcrumb navigation in that they&#8217;re individual buttons that are all smushed together. Normally, this takes a good chunk of code to pull off. Not only do you have to style the general button theme, you also have to make the first and last button different. </p>
<p>With Bootstrap, all you need are some links with the &#8220;btn&#8221; class inside of a &#8220;btn-group&#8221; div. </p>
<div>
<div>
<div>
<pre><div class<span>=</span><span>"btn-group"</span><span>></span>
  <a class<span>=</span><span>"btn"</span> href<span>=</span><span>"#"</span><span>></span>One</a<span>></span>
  <a class<span>=</span><span>"btn"</span> href<span>=</span><span>"#"</span><span>></span>Two</a<span>></span>
  <a class<span>=</span><span>"btn"</span> href<span>=</span><span>"#"</span><span>></span>Three</a<span>></span>
</div<span>></span></pre>
</div>
</div>
</div>
<p></ br></p>
<h3>Carousels</h3>
<div><img class="alignNone size-full wp-image-1611" src="http://designshack.co.uk/wp-content/uploads/bootstrap2-10.jpg" alt="Bootstrap2-10 in " width="510" /></div>
<p>The old Bootstrap JavaScript plugins have been revamped and some completely new ones have been added. My favorite here is the new jQuery carousel. The example code below may seem hefty, but if you break it down it&#8217;s pretty simple. The slide contents gets thrown in the &#8220;.item&#8221; div and an optional caption can be added. Navigation is tossed in at the end. </p>
<div>
<div>
<div>
<pre><span><<span>div</span> <span>id</span><span>=</span><span>"myCarousel"</span> <span>class</span><span>=</span><span>"carousel slide"</span>></span><br />
    <span><<span>div</span> <span>class</span><span>=</span><span>"carousel-inner"</span>></span></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://designmagazine.us/twitter-bootstrap-2-bootstrap-goes-responsive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 useful htaccess tricks to improve your website</title>
		<link>http://designmagazine.us/10-useful-htaccess-tricks-to-improve-your-website/</link>
		<comments>http://designmagazine.us/10-useful-htaccess-tricks-to-improve-your-website/#comments</comments>
		<pubDate>Tue, 14 Feb 2012 22:54:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[designer]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[ui]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[wp]]></category>
		<category><![CDATA[clients]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[designers]]></category>

		<guid isPermaLink="false">http://designmagazine.us/10-useful-htaccess-tricks-to-improve-your-website/</guid>
		<description><![CDATA[ For some reason, the .htaccess file is often overlooked by web designers. If you have no idea what the .htaccess file is, I&#8217;ll just give you the Wikipedia definition: &#8220;A .htaccess (hypertext access) file is a directory-level configuration file supported by several web servers, that allows for decentralized management of web server configuration.&#8221; But let&#8217;s get to it, here are some of the cool things you can do in your .htacces file]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p> For some reason, the .htaccess file is often overlooked by web designers. If you have no idea what the .htaccess file is, I&#8217;ll just give you the Wikipedia definition: &#8220;A .htaccess (hypertext access) file is a directory-level configuration file supported by several web servers, that allows for decentralized management of web server configuration.&#8221; But let&#8217;s get to it, here are some of the cool things you can do in your .htacces file</p>
<p></p>
<p>For some reason, the .htaccess file is often overlooked by web designers. If you have no idea what the .htaccess file is, I&#8217;ll just give you the Wikipedia definition: &#8220;A .htaccess (hypertext access) file is a directory-level configuration file supported by several web servers, that allows for decentralized management of web server configuration.&#8221;</p>
<p>But let&#8217;s get to it, here are some of the cool things you can do in your .htacces file.</p>
<h2>1. Hotlinking protection with .htaccess</h2>
<p>Websites that steal your written content can be quite annoying because they can hurt your Google rankings by creating duplicate content. However there is even worst: websites that steal your content AND don&#8217;t even make the effort of downloading images and reuploading it on their server. Loading images from your server is called hotlinking, and it&#8217;s a bad practice because it steals some of your precious bandwidth.</p>
<p>To preven people from hotlinking your images, just include the following lines in your htaccess file (obviously replace <em>yoursite.com</em> with your site&#8217;s URL.</p>
<p><em>RewriteBase /<br />
RewriteCond %{HTTP_REFERER} !^$<br />
RewriteCond %{HTTP_REFERER} !^http://(www.)?yoursite.com/.*$ [NC]<br />
RewriteRule .(gif|jpg|swf|flv|png)$ /feed/ [R=302,L]</em></p>
<h2>2. Prevent directory browsing</h2>
<p>While directory browsing can be useful, it can also cause some security problems. To make your site a bit more secure, prevent directory browsing by including this file in your htaccess.</p>
<p><em>Options All -Indexes</em></p>
<p><img class="alignnone size-full wp-image-23289" src="http://www.designer-daily.com/wp-content/uploads/2012/02/3620214358_fb78db48d1_b.jpg" alt="3620214358 Fb78db48d1 B in " width="450" height="338" /></p>
<p><em>Image credits: <a href="http://designmagazine.us?goto=ec6010530d949a52933d37087ee96654" rel="nofollow">Sens interdit</a> by <a href="http://designmagazine.us?goto=9c91eda82fc630e07df30902fa6b104f" rel="nofollow">Frédéric Bisson</a> on Flickr.</em></p>
<h2>3. SEO friendly 301 permanent redirects</h2>
<p>I&#8217;ve used this one very often, pretty much on every site where I changed the URL structure with a redesign or server move. To redirect old pages to their new address in a user-friendly way, use this structure in your htaccess.</p>
<p><em>Redirect 301 http://www.yoursite.com/article.html http://www.yoursite.com/archives/article</em></p>
<h2>4. Display a custom 404 error page</h2>
<p>When a visitor tries to access some page of your site that doesn&#8217;t exist anymore, your server will display a page with the message &#8220;404 file not found&#8221;. Some CMS allow you to set a custom page for those 404 errors, but the easiest way is still to include the following line in your htaccess file.</p>
<p><em>ErrorDocument 404 /404.html</em></p>
<p><img class="alignnone size-full wp-image-23288" src="http://www.designer-daily.com/wp-content/uploads/2012/02/5905786103_b8767f0506_b.jpg" alt="5905786103 B8767f0506 B in " width="450" height="306" /></p>
<p><em>Image credits: <a href="http://designmagazine.us?goto=9e414208dfe7b5e0f1968625e1d92b1b" rel="nofollow">404 room</a> by <a href="http://designmagazine.us?goto=2840dd065415f73c7484141d40a0930f" rel="nofollow">Raphaël Gotter</a> on Flickr.</em></p>
<h2>5. Setting the default page of a directory</h2>
<p>If for some reason you need the default page of a directory to be different, it&#8217;s very easy to do with htaccess. For example, if you want the file default.html to be the default page, just add this line.</p>
<p><em>DirectoryIndex about.html</em></p>
<h2>6. Block unwanted visitor based on referring domain</h2>
<p>Usually webmasters will not block traffic, but if you notice in your stats that some sites are just sending you spammers or trolls, you shouldn&#8217;t wait to block them, that would just help you preserve your nerves. Just add the following code to do so.</p>
<p><em><IfModule mod_rewrite.c></em><br />
<em>RewriteEngine on  RewriteCond %{HTTP_REFERER} spamteam.com [NC,OR]</em><br />
<em>RewriteCond %{HTTP_REFERER} trollteam.com [NC,OR]</em><br />
<em>RewriteRule .* &#8211; [F] </em><br />
<em></ifModule></em></p>
<h2>7. Specify upload file limit for PHP in htaccess</h2>
<p>This one helped me several times when using Drupal on shared hosting, I had to reset upload file limits to allow my clients to upload bigger files and these lines saved me. The first one is maximum file size for uploading, second one is maximum size of the post data , third one is maximum time in seconds a script is allowed to run before it is terminated by the parser and last one is maximum time in seconds a script is allowed to parse input data such as like file uploads, POST and GET data.</p>
<p><em>php_value upload_max_filesize 20M</em><br />
<em>php_value post_max_size 20M</em><br />
<em>php_value max_execution_time 200</em><br />
<em>php_value max_input_time 200</em></p>
<p><img class="alignnone size-full wp-image-23290" src="http://www.designer-daily.com/wp-content/uploads/2012/02/file_upload.jpg" alt="File Upload in " width="450" height="150" /></p>
<h2>8. Compress files</h2>
<p>Do your users a favor and optimize the loading time of pages by compressing the files you serve on your website, here is an example of how to achieve this.</p>
<p><em>AddOutputFilterByType DEFLATE text/plain</em><br />
<em>AddOutputFilterByType DEFLATE text/html</em><br />
<em>AddOutputFilterByType DEFLATE text/xml</em><br />
<em>AddOutputFilterByType DEFLATE text/css</em><br />
<em>AddOutputFilterByType DEFLATE application/xml</em><br />
<em>AddOutputFilterByType DEFLATE application/xhtml+xml</em><br />
<em>AddOutputFilterByType DEFLATE application/rss+xml</em><br />
<em>AddOutputFilterByType DEFLATE application/javascript</em><br />
<em>AddOutputFilterByType DEFLATE application/x-javascript</em></p>
<h2>9. Cache files</h2>
<p>More website speed optimization by caching files.</p>
<p><em><FilesMatch &#8220;.(flv|gif|jpg|jpeg|png|ico|swf|js|css|pdf)$&#8221;></em><br />
<em>Header set Cache-Control &#8220;max-age=2592000&#8243;</em><br />
<em></FilesMatch></em></p>
<h2>10. Force trailing slash</h2>
<p>I cannot prove it, but I&#8217;ve read countless time that adding a trailing slash at the end of the URL was good for SEO and page load. If you also believe so just add this code in your htaccess.</p>
<p><em><IfModule mod_rewrite.c> </em><br />
<em>RewriteCond %{REQUEST_URI} /+[^.]+$ </em><br />
<em>RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R=301,L]</em><br />
<em></IfModule></em></p>
<p><a href="http://designmagazine.us?goto=b9f38d0acc2b3bbbd2da90034aeaedc6" rel="nofollow"><img src="http://feedads.g.doubleclick.net/~a/wbI8JREKohx3Y3fU_6tGJz7r_Qs/0/di" border="0" ismap="true" alt=" in " /></img></a><br/><br />
<a href="http://designmagazine.us?goto=d349ec4e3b912ab3802114fadc47ae5b" rel="nofollow"><img src="http://feedads.g.doubleclick.net/~a/wbI8JREKohx3Y3fU_6tGJz7r_Qs/1/di" border="0" ismap="true" alt=" in " /></img></a></p>
<div>
<a href="http://designmagazine.us?goto=a88537b857a64b11db99f8bad19b66a7" rel="nofollow"><img src="http://feeds.feedburner.com/~ff/DailyDesignerNews?d=yIl2AUoC8zA" border="0" alt=" in " /></img></a> <a href="http://designmagazine.us?goto=77689a1dbae7eaa6fb76308b0cebb428" rel="nofollow"><img src="http://feeds.feedburner.com/~ff/DailyDesignerNews?i=wiTHQX7jJ5o:mx21pHr5AeM:F7zBnMyn0Lo" border="0" alt=" in " /></img></a> <a href="http://designmagazine.us?goto=01ef25f3cd8960fa795dfdfab98a31de" rel="nofollow"><img src="http://feeds.feedburner.com/~ff/DailyDesignerNews?i=wiTHQX7jJ5o:mx21pHr5AeM:gIN9vFwOqvQ" border="0" alt=" in " /></img></a>
</div>
<p><img src="http://feeds.feedburner.com/~r/DailyDesignerNews/~4/wiTHQX7jJ5o" height="1" width="1" alt=" in " /><br />
Artica Source: <a href="http://designmagazine.us?goto=fbd5893c301658a17ecda8f51ef39c60"target="_blank"  title="10 useful htaccess tricks to improve your website" rel="nofollow">10 useful htaccess tricks to improve your website</a></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://designmagazine.us/10-useful-htaccess-tricks-to-improve-your-website/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Callback Functions in JavaScript</title>
		<link>http://designmagazine.us/callback-functions-in-javascript/</link>
		<comments>http://designmagazine.us/callback-functions-in-javascript/#comments</comments>
		<pubDate>Tue, 14 Feb 2012 11:00:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[JavaScript & jQuery]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[ui]]></category>
		<category><![CDATA[Web Design Tutorials]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wp]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[wikipedia]]></category>

		<guid isPermaLink="false">http://designmagazine.us/callback-functions-in-javascript/</guid>
		<description><![CDATA[ If you&#8217;re fairly inexperienced with JavaScript but you&#8217;ve used jQuery, then its likely you&#8217;ve used callback functions . But maybe you don&#8217;t fully understand how they work or how they&#8217;re implemented. In this post, which is based on what I&#8217;ve learned about callback functions, I&#8217;ll try to enlighten you on this fairly common JavaScript technique]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p> If you&#8217;re fairly inexperienced with JavaScript but you&#8217;ve used jQuery, then its likely you&#8217;ve used callback functions . But maybe you don&#8217;t fully understand how they work or how they&#8217;re implemented. In this post, which is based on what I&#8217;ve learned about callback functions, I&#8217;ll try to enlighten you on this fairly common JavaScript technique</p>
<p></p>
<p><img src="http://designmagazine.us/wp-content/uploads/2012/02/0b92ce5b1actions.jpg.jpg" alt="0b92ce5b1actions Jpg in " width="184" height="184" />If you&#8217;re fairly inexperienced with JavaScript but you&#8217;ve used jQuery, then its likely you&#8217;ve used <a href="http://designmagazine.us?goto=e87231ed61f5100d20847f6fb4f2187a" rel="nofollow">callback functions</a>. But maybe you don&#8217;t fully understand how they work or how they&#8217;re implemented.</p>
<p>In this post, which is based on what I&#8217;ve learned about callback functions, I&#8217;ll try to enlighten you on this fairly common JavaScript technique. And maybe some of our JavaScript experts can chime in and let me know what I&#8217;ve omitted or oversimplified.</p>
<h2>What is a Callback Function?</h2>
<p>The above-linked Wikipedia article defines it nicely:</p>
<blockquote><p>A reference to executable code, or a piece of executable code, that is passed as an argument to other code.</p>
</blockquote>
<p>Here&#8217;s a simple example that&#8217;s probably quite familiar to everyone, taken from jQuery:</p>
<pre name="code">
$('#element').fadeIn('slow', function() {
    // callback function
});
</pre>
<p>This is a call to jQuery&#8217;s <a href="http://designmagazine.us?goto=b78c3fa8c2331fadefeaa5782f0da5aa" rel="nofollow">fadeIn()</a> method. This method accepts two arguments: The speed of the fade-in and an optional callback function. In that function you can put whatever you want.</p>
<p>When the <code>fadeIn()</code> method is completed, then the callback function (if present) will be executed. So, depending on the speed chosen, there could be a noticeable delay before the callback function code is executed. You can read more about jQuery&#8217;s callback functions <a href="http://designmagazine.us?goto=b021ff143cf6d8c4a6d0b72abe4e0cbe" rel="nofollow">here</a>.</p>
<h2>How to Write a Callback Function</h2>
<p>If you&#8217;re writing your own functions or methods, then you might come across a need for a callback function. Here&#8217;s a very simple example of a custom callback function:</p>
<pre name="code">
function mySandwich(param1, param2, callback) {
    alert('Started eating my sandwich.nnIt has: ' + param1 + ', ' + param2);
    callback();
}

mySandwich('ham', 'cheese', function() {
    alert('Finished eating my sandwich.');
});
</pre>
<p>Here we have a function called <code>mySandwich</code> and it accepts three parameters. The third parameter is the callback function. When the function executes, it spits out an alert message with the passed values displayed. Then it executes the callback function.</p>
<p>Notice that the actual parameter is just &#8220;callback&#8221; (without parentheses), but then when the callback is executed, it&#8217;s done using parentheses. You can call this parameter whatever you want, I just used &#8220;callback&#8221; so it&#8217;s obvious what&#8217;s going on.</p>
<p>The callback function itself is defined in one the third argument passed to the function call. That code has another alert message to tell you that the callback code has now executed. You can see in this simple example that an argument passed into a function can be a function itself, and this is what makes callbacks possible in JavaScript.</p>
<p>Here&#8217;s <a href="http://designmagazine.us?goto=e45b7e8a388361150ae8ec8f4756b829" rel="nofollow">a JSBin</a> that uses the simple example above.</p>
<h2>Make the Callback Optional</h2>
<p>One thing you&#8217;ll notice about jQuery callbacks is that they&#8217;re optional. This means if a method accepts a callback, it won&#8217;t return an error if a callback is not included. In our simple example, the page will return an error if we call the function without a callback, like this:</p>
<pre name="code">
function mySandwich(param1, param2, callback) {
    alert('Started eating my sandwich.nnIt has: ' + param1 + ', ' + param2);
    callback();
}

mySandwich('ham', 'cheese');
</pre>
<p>You can see this in action <a href="http://designmagazine.us?goto=f2833142b74b84a3f18f0779c02591f7" rel="nofollow">here</a>. If you open your developer tools, you&#8217;ll see an error that says &#8220;undefined is not a function&#8221; (or something similar) that appears after the initial alert message.</p>
<p>To make the callback optional, we can just do this:</p>
<pre name="code">
function mySandwich(param1, param2, callback) {
    alert('Started eating my sandwich.nnIt has: ' + param1 + ', ' + param2);
    if (callback) {
        callback();
    }
}

mySandwich('ham', 'cheese');
</pre>
<p>Now, since we&#8217;re checking to ensure the existence of <code>callback</code>, the function call won&#8217;t cause an error without it. You can test this example <a href="http://designmagazine.us?goto=7c4ca2dee5910e378247a86170d69a2c" rel="nofollow">here</a>.</p>
<h2>Make Sure the Callback is a Function</h2>
<p>Finally, you can ensure that whatever value is passed as the third argument is in fact a proper function, by doing this:</p>
<pre name="code">
function mySandwich(param1, param2, callback) {
    alert('Started eating my sandwich.nnIt has: ' + param1 + ', ' + param2);
    if (callback &#038;&#038; typeof(callback) === "function") {
        callback();
    }
}

mySandwich('ham', 'cheese', 'vegetables');
</pre>
<p>Notice that the function now includes a test using the <code>typeof</code> operator, to ensure that whatever is passed is actually a function. The function call has a third argument passed, but it&#8217;s not a function, it&#8217;s a string. So the test using <code>typeof</code> ensures no error occurs.</p>
<p><a href="http://designmagazine.us?goto=136161a91279d8e046e699941de1687f" rel="nofollow">Here&#8217;s a JSBin</a> with a nonfunction argument passed as the callback.</p>
<h2>A Note About Timing</h2>
<p>Although it is true that a callback function will execute last if it is placed last in the function, this will not always appear to happen. For example, if the function included some kind of asynchronous execution (like an Ajax call or an animation), then the callback would execute after the asynchronous action begins, but possibly before it finishes.</p>
<p>Here&#8217;s an example that uses jQuery&#8217;s <code>animate</code> method:</p>
<pre name="code">
function mySandwich(param1, param2, callback) {
    alert('Started eating my sandwich.nnIt has: ' + param1 + ', ' + param2);

    $('#sandwich').animate({
        opacity: 0
    }, 5000, function() {
        // Animation complete.
    });

    if (callback &#038;&#038; typeof(callback) === "function") {
        callback();
    }
}

mySandwich('ham', 'cheese', function() {
    alert('Finished eating my sandwich.');
});
</pre>
<p>And again <a href="http://designmagazine.us?goto=9e32f7b1e9af96cb9c6870624cd1484d" rel="nofollow">here&#8217;s that code live</a>.</p>
<p>Notice that although the callback appears later in source order than the animation, the callback will actually execute long before the animation completes. In this case, solving this problem is easy: You just put the callback execution inside the <code>animate</code> method&#8217;s callback function (where it says &#8220;Animation complete&#8221;).</p>
<p>This doesn&#8217;t cover all the details regarding asynchronous functions, but it should serve as a basic warning that callback functions will only execute last as long as all the code in the function is synchronous.</p>
<h2>Anything to Add?</h2>
<p>For most JavaScript junkies, this is probably pretty easy stuff. So forgive me if you were expecting something deeper &#8212; this is the best I can do. <img src='http://designmagazine.us/wp-includes/images/smilies/icon_smile.gif' alt="Icon Smile in " class='wp-smiley' />  But if you have anything else to add or want to correct anything I&#8217;ve said, please do so.</p>
<p> <img src="http://www.impressivewebs.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&#038;post_id=5540" width="1" height="1" style="display: none;" alt=" in " />
<p>Related posts:
<ol>
<li><a href="http://designmagazine.us?goto=79bb139dc0d0702ccab5aab8be98ab8e"  rel="bookmark nofollow" title="Triggering CSS3 Transitions With JavaScript">Triggering CSS3 Transitions With JavaScript</a></li>
<li><a href="http://designmagazine.us?goto=d3ebb704020a60e1cd7ae247a120b780"  rel="bookmark nofollow" title="A JavaScript Content Switcher That Works Without JavaScript">A JavaScript Content Switcher That Works Without JavaScript</a></li>
<li><a href="http://designmagazine.us?goto=ea2b8c938029983c5a412a863889a33e"  rel="bookmark nofollow" title="Using JavaScript’s Try-Catch Statement">Using JavaScript&#8217;s Try-Catch Statement</a></li>
</ol>
<p><a href="http://designmagazine.us?goto=2d5448353af7ab991151f48629a37d8c" rel="nofollow"><img src="http://feedads.g.doubleclick.net/~a/Hp-Sw2vDz0M16L5wAY4ru3Kyjts/0/di" border="0" ismap="true" alt=" in " /></img></a><br/><br />
<a href="http://designmagazine.us?goto=9b5368458afcc904f3353ef1d107ccda" rel="nofollow"><img src="http://feedads.g.doubleclick.net/~a/Hp-Sw2vDz0M16L5wAY4ru3Kyjts/1/di" border="0" ismap="true" alt=" in " /></img></a></p>
<div>
<a href="http://designmagazine.us?goto=1927527354cfbc85b8eeefa2c3c874d0" rel="nofollow"><img src="http://feeds.feedburner.com/~ff/ImpressiveWebs?d=yIl2AUoC8zA" border="0" alt=" in " /></img></a> <a href="http://designmagazine.us?goto=806401864b43d910b02d9a0e2f737de9" rel="nofollow"><img src="http://feeds.feedburner.com/~ff/ImpressiveWebs?i=d9qCSUwBqC0:mHwhWu5HyII:D7DqB2pKExk" border="0" alt=" in " /></img></a>
</div>
<p><img src="http://feeds.feedburner.com/~r/ImpressiveWebs/~4/d9qCSUwBqC0" height="1" width="1" alt=" in " /><br />
Artica Source: <a href="http://designmagazine.us?goto=c78288051ba3ccf59a8ccd1515f785c9"target="_blank"  title="Callback Functions in JavaScript" rel="nofollow">Callback Functions in JavaScript</a></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://designmagazine.us/callback-functions-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Progressive And Responsive Navigation</title>
		<link>http://designmagazine.us/progressive-and-responsive-navigation/</link>
		<comments>http://designmagazine.us/progressive-and-responsive-navigation/#comments</comments>
		<pubDate>Mon, 13 Feb 2012 11:53:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[accessibility]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[color]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[designer]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[links]]></category>
		<category><![CDATA[responsive]]></category>
		<category><![CDATA[space]]></category>
		<category><![CDATA[techniques]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[ui]]></category>
		<category><![CDATA[wide]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wp]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[result]]></category>

		<guid isPermaLink="false">http://designmagazine.us/progressive-and-responsive-navigation/</guid>
		<description><![CDATA[ ]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://designmagazine.us/progressive-and-responsive-navigation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Beginner’s Guide To jQuery-Based JSON API Clients</title>
		<link>http://designmagazine.us/a-beginners-guide-to-jquery-based-json-api-clients/</link>
		<comments>http://designmagazine.us/a-beginners-guide-to-jquery-based-json-api-clients/#comments</comments>
		<pubDate>Fri, 10 Feb 2012 10:37:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[resources]]></category>
		<category><![CDATA[responsive]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[techniques]]></category>
		<category><![CDATA[trends]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[ui]]></category>
		<category><![CDATA[UX]]></category>
		<category><![CDATA[wp]]></category>
		<category><![CDATA[year]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[result]]></category>

		<guid isPermaLink="false">http://designmagazine.us/a-beginners-guide-to-jquery-based-json-api-clients/</guid>
		<description><![CDATA[ ]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://designmagazine.us/a-beginners-guide-to-jquery-based-json-api-clients/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Three Super Easy Ways to Pull Off a Masonry Layout</title>
		<link>http://designmagazine.us/three-super-easy-ways-to-pull-off-a-masonry-layout/</link>
		<comments>http://designmagazine.us/three-super-easy-ways-to-pull-off-a-masonry-layout/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 06:00:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[designer]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[layouts]]></category>
		<category><![CDATA[responsive]]></category>
		<category><![CDATA[space]]></category>
		<category><![CDATA[techniques]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[ui]]></category>
		<category><![CDATA[UX]]></category>
		<category><![CDATA[wide]]></category>
		<category><![CDATA[wp]]></category>
		<category><![CDATA[efficiency]]></category>
		<category><![CDATA[opinion]]></category>

		<guid isPermaLink="false">http://designmagazine.us/three-super-easy-ways-to-pull-off-a-masonry-layout/</guid>
		<description><![CDATA[ Masonry style layouts push the boundaries of creative layout techniques. I personally love how capable they prove to be at maximizing the efficiency of galleries containing items with varying heights]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p> Masonry style layouts push the boundaries of creative layout techniques. I personally love how capable they prove to be at maximizing the efficiency of galleries containing items with varying heights</p>
<p></p>
<div><img class="alignNone size-full wp-image-1611" src="http://designshack.co.uk/wp-content/uploads/masonry-layout-0.jpg" alt="Masonry-layout-0 in " width="510" /></div>
<p>Masonry style layouts push the boundaries of creative layout techniques. I personally love how capable they prove to be at maximizing the efficiency of galleries containing  items with varying heights. Every bit of screen space is used and the result can be downright mesmerizing.</p>
<p>Today we&#8217;re going to dive into the concept, ideas and popular techniques that are currently prevalent in masonry style layouts. We&#8217;ll learn three different methods for pulling off a masonry layout, discuss the ins and outs of each and make sure that the result is beautifully responsive and reflows based on browser width. </p>
<p><span></span><br />
<em>Like the article? Be sure to subscribe to our <a href="http://designmagazine.us?goto=8ab82af6ff52e376bde20ec73502d4ba"rel="nofollow">RSS feed</a> and follow us on <a rel="nofollow" target="_blank" >Twitter</a> to stay up on recent content.</em></p>
<h2>What Is a Masonry Layout?</h2>
<p>When you float objects in CSS, the browser arranges elements first horizontally then vertically. When we fill a container with a bunch of equally sized objects and float them left, we get a nice grid of images.</p>
<div><img class="alignNone size-full wp-image-1611" src="http://designshack.co.uk/wp-content/uploads/masonry-layout-2.jpg" alt="Masonry-layout-2 in " width="510" /></div>
<p>However, if the objects have variable heights, the results are much more difficult to predict. Instead of a nice tight grid, we get something that tends to be fairly scattered. </p>
<div><img class="alignNone size-full wp-image-1611" src="http://designshack.co.uk/wp-content/uploads/masonry-layout-1.jpg" alt="Masonry-layout-1 in " width="510" /></div>
<p>The obvious quandary here is how to pull off a nice tight grid that with items that have variable heights. It&#8217;s a pretty interesting topic and various developers have come up with several ways to go about it. Let&#8217;s take a look at three of the current best solutions. </p>
<p>To go one step further, we&#8217;re going to make sure that all three solutions are responsive, meaning the grid will reflow as the window size changes. </p>
<h2>jQuery Masonry</h2>
<div><a href="http://designmagazine.us?goto=fa4092d4d8907ecf9ae90492bd92298d"rel="nofollow" target="_blank" ><img class="alignNone size-full wp-image-1611" src="http://designshack.co.uk/wp-content/uploads/masonry-layout-6.jpg" alt="Masonry-layout-6 in " width="510" /></a></div>
<p><a href="http://designmagazine.us?goto=7fce4f96d693288444884c918eed715b"rel="nofollow" target="_blank" >jQuery Masonry</a> is the most popular solution to pull off this type of layout. It utilizes some pretty fancy JavaScript to reflow a series of divs. </p>
<p>Putting Masonry into practice is pretty easy, all you need is a container that holds a series of divs that you want to arrange masonry style. You can place anything you want inside the divs, in this case I threw in some placeholder images.</p>
<p>Once you have that in order, toss in jQuery and jQuery Masonry. Then you need to create a simple function that identifies your container and targets the class that we used for our Masonry images divs. Here&#8217;s a basic example:</p>
<div>
<div>
<div>
<pre><span><<span>div</span> <span>id</span><span>=</span><span>"container"</span>></span><br />
	<span><<span>div</span> <span>class</span><span>=</span><span>"masonryImage"</span>></span><br />
		<span><<span>img</span> <span>src</span><span>=</span><span>"http://designshack.co.uk/wp-content/uploads/http://lorempixum.com/200/200/food/1"</span> <span>alt</span><span>=</span><span>""</span> <span>/</span>></span><br />
	<span><<span>/</span><span>div</span>></span></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://designmagazine.us/three-super-easy-ways-to-pull-off-a-masonry-layout/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Beginner’s Guide to Using AJAX in Your Website</title>
		<link>http://designmagazine.us/a-beginners-guide-to-using-ajax-in-your-website/</link>
		<comments>http://designmagazine.us/a-beginners-guide-to-using-ajax-in-your-website/#comments</comments>
		<pubDate>Mon, 06 Feb 2012 11:00:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[resources]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[ui]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[wide]]></category>
		<category><![CDATA[wp]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[guidelines]]></category>
		<category><![CDATA[result]]></category>

		<guid isPermaLink="false">http://designmagazine.us/a-beginners-guide-to-using-ajax-in-your-website/</guid>
		<description><![CDATA[ AJAX is a method that has been around for a while, yet in the past was not something that was used by many developers. Only recently has it been gaining more attention, especially with the rise in web applications that demand a better user experience]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p> AJAX is a method that has been around for a while, yet in the past was not something that was used by many developers. Only recently has it been gaining more attention, especially with the rise in web applications that demand a better user experience</p>
<p><a href="http://designmagazine.us?goto=a970ef2741c5e815d43892e7e0090c4d" rel="nofollow"><img src="http://feedads.g.doubleclick.net/~a/bcDQ8nSCczjIn7Nbv8e7kteBAC0/0/di" border="0" ismap="true" alt=" in " /></img></a><br/><br />
<a href="http://designmagazine.us?goto=444632dab5e46633fafd059633a299d6" rel="nofollow"><img src="http://feedads.g.doubleclick.net/~a/bcDQ8nSCczjIn7Nbv8e7kteBAC0/1/di" border="0" ismap="true" alt=" in " /></img></a></p>
<p><strong>AJAX</strong> is a method that has been around for a while, yet in the past was not something that was used by many developers. Only recently has it been gaining more attention, especially with the rise in <strong>web applications</strong> that demand a better user experience. AJAX is not a programming language in itself, but rather a new way to use JavaScript in relation to a web page, and it&#8217;s this new technology that can make webpages faster, more user-friendly, and the overall function more efficiently.</p>
<p><img src="http://net.onextrapixel.com/wp-content/uploads/2011/12/ajax.jpg" alt="Ajax in " width="580" height="360" class="alignnone size-full wp-image-16337" /><br />
<span></span><br />
AJAX stands for Asynchronous JavaScript and XML, and is used for updating and interacting with a server via JavaScript, therefore allowing far more functionality with the server without having to reload the webpage. In this article, we&#8217;ll go over the basics for implementing AJAX into your website.</p>
<h2>If You Know JavaScript, AJAX is Easy</h2>
<p>If you understand at least the basics of JavaScript, you&#8217;ll be able to pick up AJAX quite easily. You can make a page interact with the user with JavaScript alone, and then based on those user interactions you can send, receive, or update page content in relation to the server&#8217;s response when needed.</p>
<p>Let&#8217;s say we have a simple button, and we want it to update some data on the page. Imagine we have some input fields before this that the update button will take care of.</p>
<pre>
<button onclick="updateProfile()" type="button">Update</button>
</pre>
<p>As seen in the button code above, upon clicking on the button, we can call a JavaScript function <code>updateProfile()</code>. If you know JavaScript, there&#8217;s nothing new there. The function that is defined between <code>script</code> tags will then be called:</p>
<pre>
<script type="text/javascript">
function updateProfile(){
	// JavaScript code to be executed
}
</script>
</pre>
<p>As is best practice, these script tags and all code in between can be placed right before the <code>body</code> tag. Alternatively the JavaScript can be placed within the header <em>(depending on the site structure or specific needs for this page, it may be smarter)</em>. Of course, with larger pieces of code, it should be placed within a JavaScript file <code>.js</code> and the file should be included in the header.</p>
<p>From here on, we can place any code we want executed when that button is pressed inside of this function. Again, nothing new here. With traditional JavaScript, we could manipulate any content that is already in the page, as long as it didn&#8217;t need any more data from the server. A good example of using JavaScript only can be found here: <a href="http://designmagazine.us?goto=14907ed9803abbd87f32a607248800e1" rel="nofollow">Freelance Finances Calculator</a>.</p>
<p>If we needed additional data from the server, we would need to bring in a server-side scripting language and reload the page entirely. That&#8217;s where AJAX comes in — to solve this problem. Within the <code>updateProfile()</code> function, we can use AJAX code to interact with the server <em>(via JavaScript!)</em>, and we are now able to retrieve, update, and delete information as needed on the server, no reload required.</p>
<pre>
<script type="text/javascript">
function updateProfile(){
	// JavaScript code to be executed
	// AJAX code will go here as well!
}
</script>
</pre>
<h2>The XMLHttpRequest and ActiveXObject Objects</h2>
<p>In order to begin using AJAX code, you need to tell the browser that it will be interacting with the server. In JavaScript there are two objects that help AJAX work: the <code>XMLHttpRequest</code> and <code>ActiveXObject</code> objects. While these are the basis for object-oriented programming with JavaScript, you don&#8217;t need to understand or implement object-oriented concepts to an extent to use AJAX. In fact, we&#8217;ll walk you through it right here.</p>
<p>Both objects do the same thing, but they are just meant to support different browsers. The objects are meant to exchange and handle data with the server behind the scenes of the webpage; simple as that.</p>
<p>To tell the browser you will be using AJAX, use the following code (Credit to <a href="http://designmagazine.us?goto=65f467e0a8e586462334196c662707eb" rel="nofollow">W3Schools</a>):</p>
<pre>
<script type="text/javascript">
function updateProfile(){
	// Create a variable to refer to our request object:
	var xmlhttp;

	if (window.XMLHttpRequest){
		// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
	}else{
		// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
}
</script>
</pre>
<p>The code above is pretty simple. First, we create a variable that will hold our object; whether it is a <code>XMLHttpRequest</code> or <code>ActiveXObject</code> will be dependent on what browser the user is in. <em>(Remember, they both do the same thing.)</em> If we can detect that our browser can handled the <code>XMLHttpRequest</code> object via <code>window.XMLHttpRequest</code>, then we can set our variable to this object. Otherwise, we should set it to the <code>ActiveXObject</code>.</p>
<p>This will be the start of any AJAX code you place into a website. Note that if you are using multiple functions, it may not be the most efficient solution to declare this code at the beginning of every function. If used within several functions, it would be more efficient to set this variable on page load.</p>
<h2>Receiving Requests from the Server</h2>
<p>Now that AJAX is &#8220;all set up&#8221; for use in our browser, we can begin the fun part &#8211; interacting with our server. Whichever request object is used (based on the browser), there are a set of pre-defined functions we can use to get information from a server via AJAX, send information, or manipulate information.</p>
<p>The first pre-defined property we&#8217;ll look into is the <code>onreadystatechange</code> property. The does just what it says, it calls the function it holds (see below) when the <code>readyState</code> is changed. The <code>readyState</code> is just the state our server tells us it&#8217;s in: processing, downloading, or completed.</p>
<pre>
xmlhttp.onreadystatechange = function(){
	// This code will be executed each time the readyState changes
}
</pre>
<p>Each <code>readyState</code> is defined by a number, and we can check to see if our current readyState equals that number to process our code dependent on what the server&#8217;s doing:</p>
<ul>
<li>ajaxRequest.readyState == 0 // request not initialized</li>
<li>ajaxRequest.readyState == 1 // server connection established</li>
<li>ajaxRequest.readyState == 2 // request received</li>
<li>ajaxRequest.readyState == 3 // processing</li>
<li>ajaxRequest.readyState == 4 // completed and response is ready</li>
</ul>
<p>For example, if we wanted to execute some code only after the data or actions we&#8217;ve requested and ready and have our feedback for us, we&#8217;d check to make sure our <code>readyState</code> was at 4:</p>
<pre>
xmlhttp.onreadystatechange = function(){
	// This code will be executed each time the readyState changes
	if(ajaxRequest.readyState == 4){
		// This code will be executed if our request
		// is completed
	}
}
</pre>
<p>We can access the data we&#8217;re requesting by using either the <code>responseText</code> or <code>responseXML</code> properties respectively. responseText is for retrieving text-based data, while responseXML can be used for retrieving XML based data. Then, using basic JavaScript again, we can use these properties to assign our feedback from the server in a div, or do whatever else we like with it:</p>
<pre>
xmlhttp.onreadystatechange = function(){
  // This code will be executed each time the readyState changes
  if(ajaxRequest.readyState == 4){
     document.getElementById("myData").innerHTML=xmlhttp.responseText;
  }
}
</pre>
<p>Hopefully you can understand the logic behind all this, but of course none of the above will do us any good as long as we don&#8217;t tell our code what we want to request in the first place. We needed to create a function to handle our request first, and the above code simply explains how we&#8217;ll show our data from the server after we&#8217;ve requested it.</p>
<h2>Sending Requests to the Server</h2>
<p>Like with receiving responses from the server, our request object also has pre-defined properties and functions for dealing with sending requests to the server. Anytime we need to send new information, manipulate information, or send instructions of any type to work with our web application, we&#8217;ll be sending a request to the server. After we&#8217;ve sent the request, we can turn around and use the function we created above (using <code>onreadystatechange</code>) to see our results.</p>
<p>There are two parts to sending a request to the server via AJAX, as seen in the example below:</p>
<pre>
xmlhttp.open("GET","ourPHPCode.php",true);
xmlhttp.send();
</pre>
<p>The first prebuilt function, <code>open()</code>, let&#8217;s us define what server-side script we&#8217;ll be using to communicate with the server. We include our server-side script as the second parameter and it will be processed without refreshing the page. This function also holds a few other arguments that we&#8217;ll look into more detail soon.</p>
<p>Included in our server side script <code>ourPHPcode.php</code>, we&#8217;ll include the more in-depth instructions that will work with our server. After AJAX opens the server-side script file via the <code>open()</code> method, we can send those instructions out via the <code>send()</code> method.</p>
<pre>
<script type="text/javascript">
function updateProfile(){
	// Let's first create our request object:
	var xmlhttp;

	if (window.XMLHttpRequest){
		xmlhttp=new XMLHttpRequest();
	}else{
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}

	// This code will be executed each time the readyState changes
	xmlhttp.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			document.getElementById("myData").innerHTML=xmlhttp.responseText;
		}
	}

	// We'll send any data to the server through our request object
	xmlhttp.open("GET","ourPHPCode.php",true);
	xmlhttp.send();
}
</script>
</pre>
<h4>A Closer Look at Open()</h4>
<p>When we are opening a file to send to the server via AJAX, the most important portion item is the link to our server-side file. Beyond this though, we have two more: the method for sending the request and async.</p>
<pre>
open(method,file,async);
Example: open("POST", "myFile.aspx", false);
</pre>
<p>The method for the <code>open()</code> function can either be <code>GET</code> or <code>POST</code>. If you are familiar with PHP <em>(and many other similar languages)</em> and sending data via HTML forms, the concept is much the same. <code>GET</code> can be used in most situations, and you can even send values through an URL like with HTML forms:</p>
<pre>
open("GET", "ourPHPCode.php?email=test@test.com&#038;firsname=Johnny&#038;lastname=Smith", false);
</pre>
<p><code>GET</code> will often times get you a cached result, which you may not always want. If you still would like to use the <code>GET</code> method, you can simply create a <em>&#8220;new, fresh URL&#8221;</em> for the browser to go to by appending a unique ID, so it will send you an uncached result:</p>
<pre>
open("GET", "ourPHPCode.php?x=", false);
</pre>
<p><code>POST</code> can be more secure than <code>GET</code>, and also has no size limitations. If you&#8217;re ever working with data sensitive information <em>(like passwords)</em>, then use &#8220;POST&#8221;.</p>
<p><strong>Async, the last parameter,</strong> can either be set to <code>true</code> or <code>false</code>. You&#8217;ll want to use true the majority of the time, and false can sometimes be used for smaller requests. Setting asynchronous to true simply means you&#8217;ll be able to do other functions while your AJAX request is waiting for the server response. <em>(It&#8217;s recommended.)</em> </p>
<h2>Working with a Server-Side Language</h2>
<p>After we&#8217;ve set up our AJAX to request information from a server-side script and also to handle its response, there&#8217;s really nothing new or magical about our server-side script. The code is the same, and whatever you do with it will follow the same syntax as always. All AJAX does is help to be the middleman while this script executes and handles all the dirty work, allowing us to eliminate or cut down on the need for page refreshes, and allowing us to execute other functionality on a page while our server-side script is working with the server.</p>
<p>Let&#8217;s say we simply want to echo out a string <em>(via PHP)</em> when we change some form input. We&#8217;ll use our function that we created above, which defines our AJAX request object, tells the browser what to request, and where to put the response.</p>
<p>Our HTML file <em>(with our AJAX/JavaScript)</em>:</p>
<pre>
<html>
<head>
<script type="text/javascript">
function updateProfile(){
	// Let's first create our request object:
	var xmlhttp;

	if (window.XMLHttpRequest){
		xmlhttp=new XMLHttpRequest();
	}else{
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}

	// This code will be executed each time the readyState changes
	xmlhttp.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			document.getElementById("myData").innerHTML=xmlhttp.responseText;
		}
	}

	// We'll send any data to the server through our request object
	xmlhttp.open("GET","ourPHPCode.php",true);
	xmlhttp.send();
}
</script>
</head>
<body>
	<input name='firstName' onChange='updateProfile()' />

	<div id="myDate"></div>
	<!-- Our response will be placed into the div above,
	thanks to JavaScript's "innerHTML" property. -->
</body>
</html>
</pre>
<p>Our PHP file <code>ourPHPCode.php</code>.</p>
<pre>
<?php
	echo "The input field was changed.";
?>
</pre>
<p>Using JavaScript&#8217;s <code>onChange</code> event, we trigger our JavaScript function, <code>updateProfile()</code>. Within this function we&#8217;ve done all our AJAX set up, and sent a request to our PHP file, <code>ourPHPCode.php</code>, which simply echos back our string. Therefore, we use the power of AJAX to echo out this string when our input field is changed. There is no need for refreshing or waiting on a slow response for a server.</p>
<p>Obviously, this example is incredibly simple and very pointless. This is just, at the most basic level, how we can connect a server-side script with an HTML page using the power of AJAX. Within the PHP script, you can take in data from a form (for example if we used the <code>POST</code> method in our <code>open()</code> function, we could just use PHP&#8217;s <code>$_POST</code> variable to obtain that information), manipulate it, send it to a server, update information in a database, and return a response via PHP&#8217;s <code>echo</code> statement.</p>
<p>Let&#8217;s say we have a simple HTML form that asks for a name and email. Below is an example of something more elaborate:</p>
<p>Our HTML/JavaScript page:</p>
<pre>
<html>
<head>
<script type="text/javascript">
function updateProfile(){
	// Let's first create our request object:
	var xmlhttp;

	if (window.XMLHttpRequest){
		xmlhttp=new XMLHttpRequest();
	}else{
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}

	// This code will be executed each time the readyState changes
	xmlhttp.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			document.getElementById("myData").innerHTML=xmlhttp.responseText;
		}
	}

	// We'll send any data to the server through our request object
	xmlhttp.open("GET","ourPHPCode.php",true);
	xmlhttp.send();
}
</script>
</head>
<body>

	<form>
	<label>First Name;</label><br />
	<input type='text' name='firstName' />

	<label>First Name;</label><br />
	<input type='text' name='lastName' />

	<label>First Name;</label><br />
	<input type='text' name='email' />

	<input type=submit' onClick='updateProfile()' />

	</form>

	<div id="myDate"></div>
	<!-- Our response will be placed into the div above,
		thanks to JavaScript's "innerHTML" property. -->

</body>
</html>
</pre>
<p>Our PHP Script:</p>
<pre>
<?php
	$firstName = $_POST['firstName'];
	$lastName = $_POST['lastName'];
	$email = $_POST['email'];

	$response = '';

	// Now you have variables from the form, and you can do whatever with them:
	// validate them, update a database, insert them into a database, or whatever.
	// You can do whatever you'd normally do with regular PHP here.

	// You can then create a response variable, set it to whatever value you'd
	// like to send back to the user, and AJAX will update it automatically.

	// Examples:

	if(// Email isn't valid){
		$response = "The email address you entered isn't valid.";
	}

	if(// Everything checks out ok and was submitted properly){
		$response = "Your profile has been updated!";
	}

	echo $response;
?>
</pre>
<p>The above shows how we can manipulate form data, and one can see that there&#8217;s no difference in how we use our PHP code to work with a server. We could also include a link to a database connection and work with a database with the information we grabbed from the same page. Just like an HTML form or otherwise can use <code>POST</code> to send data, so can AJAX. From a server-side script&#8217;s perspective, it&#8217;s all the same.</p>
<h2>Conclusion</h2>
<p>AJAX is a revolution to web technology, allowing our client-side scripting to reach server data as needed, yet still allowing us to code with the faster and often times more user-friendly benefits of client-side. It&#8217;s been around for a while, but it&#8217;s great to see now how AJAX is really taking off as common practice.</p>
<p>While there are endless tutorials on the web for doing specific things with AJAX, such as creating chat boxes, live feeds, updating info on the fly, and so much more, it&#8217;s more important than ever to understand the basis of how AJAX works. Having a true understanding of AJAX can help any developer to use the technology to the fullest and in a wide variety of siutations most efficiently.</p>
<ul>
<li><a href="http://designmagazine.us?goto=e10c65333a63e757bd760d9e8270eaff" title="Web Design: Say No to Spec" rel="nofollow">Web Design: Say No to Spec</a></li>
<li><a href="http://designmagazine.us?goto=7f7ad9cde85c9f279484c13d11fe1047" title="Building Web Apps: File and Directory Structures" rel="nofollow">Building Web Apps: File and Directory Structures</a></li>
<li><a href="http://designmagazine.us?goto=27be7e605d3e1ebbbcca4e7ef8520258" title="Creating a Groupon-Like Count Down Timer" rel="nofollow">Creating a Groupon-Like Count Down Timer</a></li>
<li><a href="http://designmagazine.us?goto=661e65b2594ce2cec19328cf8f183c8a" title="Design Research: Methods and Perspectives" rel="nofollow">Design Research: Methods and Perspectives</a></li>
</ul>
<hr />
<p>Written by: Kayla Knight for <a href="http://designmagazine.us?goto=4cb00dd35a8b63e395ce1712e3b4ee67" rel="nofollow">Onextrapixel &#8211; Web Design &#038; Development Magazine</a> | <a href="http://designmagazine.us?goto=f42d5f6a5ac40f55fbeb52a6436cc8c0" rel="nofollow">No comment</a><br />
<br/><br />
Post Topic(s): <a href="http://designmagazine.us?goto=3d75827bc3d0ec24d39643afcdd65c19" title="View all posts in Development"  rel="category tag nofollow" >Development</a><br/>
</p>
<div>
<a href="http://designmagazine.us?goto=65ae8597f57f62431c385ede44374510" rel="nofollow"><img src="http://feeds.feedburner.com/~ff/onextrapixel?d=yIl2AUoC8zA" border="0" alt=" in " /></img></a> <a href="http://designmagazine.us?goto=df931873db494cf095427fa519a99fee" rel="nofollow"><img src="http://feeds.feedburner.com/~ff/onextrapixel?i=1tUPg0N05yc:zJXEN-nwN3Y:gIN9vFwOqvQ" border="0" alt=" in " /></img></a> <a href="http://designmagazine.us?goto=79f2a2f2f22e5b1b7c22534dafe399c2" rel="nofollow"><img src="http://feeds.feedburner.com/~ff/onextrapixel?d=qj6IDK7rITs" border="0" alt=" in " /></img></a> <a href="http://designmagazine.us?goto=5667db75d448f0ed6c8f420145a3db51" rel="nofollow"><img src="http://feeds.feedburner.com/~ff/onextrapixel?i=1tUPg0N05yc:zJXEN-nwN3Y:V_sGLiPBpWU" border="0" alt=" in " /></img></a> <a href="http://designmagazine.us?goto=186bb9f29a379a44e5c335c89301f3a2" rel="nofollow"><img src="http://feeds.feedburner.com/~ff/onextrapixel?i=1tUPg0N05yc:zJXEN-nwN3Y:F7zBnMyn0Lo" border="0" alt=" in " /></img></a> <a href="http://designmagazine.us?goto=394563a79c8fe37f8450b0ba4f2ce629" rel="nofollow"><img src="http://feeds.feedburner.com/~ff/onextrapixel?d=l6gmwiTKsz0" border="0" alt=" in " /></img></a>
</div>
<p><img src="http://feeds.feedburner.com/~r/onextrapixel/~4/1tUPg0N05yc" height="1" width="1" alt=" in " /><br />
Artica Source: <a href="http://designmagazine.us?goto=75485b8a249709aa041edfad9be1181a"target="_blank"  title="A Beginner’s Guide to Using AJAX in Your Website" rel="nofollow">A Beginner’s Guide to Using AJAX in Your Website</a></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://designmagazine.us/a-beginners-guide-to-using-ajax-in-your-website/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>5 Online Playgrounds for HTML, CSS and JavaScript Compared</title>
		<link>http://designmagazine.us/5-online-playgrounds-for-html-css-and-javascript-compared/</link>
		<comments>http://designmagazine.us/5-online-playgrounds-for-html-css-and-javascript-compared/#comments</comments>
		<pubDate>Fri, 03 Feb 2012 06:00:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[color]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[fonts]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[links]]></category>
		<category><![CDATA[resources]]></category>
		<category><![CDATA[texture]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[wide]]></category>
		<category><![CDATA[wp]]></category>
		<category><![CDATA[year]]></category>
		<category><![CDATA[coffee]]></category>
		<category><![CDATA[environments]]></category>

		<guid isPermaLink="false">http://designmagazine.us/5-online-playgrounds-for-html-css-and-javascript-compared/</guid>
		<description><![CDATA[ Local coding environments are great, but it&#8217;s often the case that I don&#8217;t want to crack open Espresso and spend a few minutes setting up to code when all I really want is to test out an idea or work on a bug. ]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p> Local coding environments are great, but it&#8217;s often the case that I don&#8217;t want to crack open Espresso and spend a few minutes setting up to code when all I really want is to test out an idea or work on a bug. </p>
<p></p>
<div><img class="alignNone size-full wp-image-1611" src="http://designshack.co.uk/wp-content/uploads/fiddlers-14.jpg" alt="Fiddlers-14 in " width="510" /></div>
<p>Local coding environments are great, but it&#8217;s often the case that I don&#8217;t want to crack open Espresso and spend a few minutes setting up to code when all I really want is to test out an idea or work on a bug. Also, sharing options for most local coding apps are limited and typically require integrating an outside app like Dropbox.</p>
<p>Online playgrounds or sandboxes such as jsFiddle solve this problem by providing you with an instantly ready coding environment for you to begin experimenting in as soon as the page loads. These tools let you combine CSS, HTML and often even JavaScript to create and share coding examples. I&#8217;m completely addicted to these things and have extensively tested every one I can get my hands on. Today I&#8217;ll go over my five favorites and discuss not only why what I like about each option, but also where they fall short. </p>
<p><span></span><br />
<em>Like the article? Be sure to subscribe to our <a href="http://designmagazine.us?goto=8ab82af6ff52e376bde20ec73502d4ba"rel="nofollow">RSS feed</a> and follow us on <a rel="nofollow" target="_blank" >Twitter</a> to stay up on recent content.</em></p>
<h2><a href="http://designmagazine.us?goto=83f93e16014fd6124a07b1f4a75db429"rel="nofollow" target="_blank" >CSSDesk</a></h2>
<div><a href="http://designmagazine.us?goto=83f93e16014fd6124a07b1f4a75db429"rel="nofollow" target="_blank" ><img class="alignNone size-full wp-image-1611" src="http://designshack.co.uk/wp-content/uploads/fiddlers-2.jpg" alt="Fiddlers-2 in " width="510" /></a></div>
<p>I&#8217;ll start with CSSDesk because it&#8217;s one of the oldest on this list. It&#8217;s been around for years now as a quiet and obscure little tool that is extremely helpful for playing with basic web code. CSSDesk is a very simple tool that focuses purely on HTML and CSS. </p>
<h3>What I Like About CSSDesk</h3>
<p>There are a lot of things that I just love about CSS Desk. There are three main sections: HTML, CSS and live preview, the sizes of which can all be easily tweaked with a click and drag. I like that you can easily see everything you need in one simple view. There&#8217;s no effort or setup here, just load the page and start creating.</p>
<p>There&#8217;s also basic syntax highlighting just like all of the other tools on this list. However, one fairly unique feature that you don&#8217;t often see in these types of tools is line numbers. It&#8217;s such a simple addition but I tend to like line numbers so I really appreciate the inclusion.  </p>
<div><img class="alignNone size-full wp-image-1611" src="http://designshack.co.uk/wp-content/uploads/fiddlers-7.jpg" alt="Fiddlers-7 in " width="510" /></div>
<p>The toolbar features are pretty cool as well, providing some options that you simply don&#8217;t find other places. In addition to the standard sharing feature, you also have the option to download what you just built. Further, there&#8217;s a set of default tiling background textures that are applied if you don&#8217;t manually override them. These are fun if you&#8217;re just building a button or widget of some kind and want something other than the typical plain white background.</p>
<div><img class="alignNone size-full wp-image-1611" src="http://designshack.co.uk/wp-content/uploads/fiddlers-6.jpg" alt="Fiddlers-6 in " width="510" /></div>
<h3>What I Don&#8217;t Like About CSSDesk</h3>
<p>Honestly, there&#8217;s not much to dislike about this one. Sure, it&#8217;s simple and doesn&#8217;t have some of the fancy features the other options have, but that&#8217;s also what makes it great. I hardly ever use this one anymore but every time I do it&#8217;s so nice I think I should stop by more often.</p>
<p>The biggest downside for hardcore coders is the lack of JavaScript support. If this is a deal breaker for you, try checking out one of the other options.</p>
<h2><a href="http://designmagazine.us?goto=c8bdce08b65bc8c8e094ce0fbb4d930a"rel="nofollow" target="_blank" >JS Bin</a></h2>
<div><a href="http://designmagazine.us?goto=c8bdce08b65bc8c8e094ce0fbb4d930a"rel="nofollow" target="_blank" ><img class="alignNone size-full wp-image-1611" src="http://designshack.co.uk/wp-content/uploads/fiddlers-1.jpg" alt="Fiddlers-1 in " width="510" /></a></div>
<p>JS Bin is another popular place to tinker around with your code. The design of this app is quite minimal and really allows you to focus on the code. By default, the page only shows the HTML and live preview panes, but you can easily add JavaScript to that as well. </p>
<h3>What I Like About JS Bin</h3>
<p>There are quite a few nice features on JS Bin. The first thing that I found myself appreciating is the fact that refreshing the page doesn&#8217;t kill your work. The preview updates automatically but for those rare times when you do need a manual refresh, it&#8217;s nice that your first instinct (Command-R) doesn&#8217;t result in the accidental loss of an hour&#8217;s worth of tinkering.</p>
<div><img class="alignNone size-full wp-image-1611" src="http://designshack.co.uk/wp-content/uploads/fiddlers-8.jpg" alt="Fiddlers-8 in " width="510" /></div>
<p>As with CSSDesk, you save, share and download your work. The place where this obviously pulls ahead though is the JavaScript implementation. You can obviously enter your own JS but as a bonus you can choose to include popular libraries like jQuery. </p>
<div><img class="alignNone size-full wp-image-1611" src="http://designshack.co.uk/wp-content/uploads/fiddlers-9.jpg" alt="Fiddlers-9 in " width="510" /></div>
<p>Another cool feature is the ability to control which panes you see by manipulating the URL. For instance, &#8220;http://jsbin.com/#javascript,html,live&#8221; will get you all three panes while &#8220;http://jsbin.com/#html,live&#8221; will just get you two.</p>
<h3>What I Don&#8217;t Like About JS Bin</h3>
<p>To be honest, JS Bin is my least favorite option on this list. It&#8217;s not bad, but it definitely lacks the charm of the others. One thing that always gets me is that there&#8217;s no dedicated place for CSS, forcing you to embed it into your HTML. This works just fine, but it&#8217;s not as nice as the intentional separation seen in the other options.</p>
<h2><a href="http://designmagazine.us?goto=d90b6a9cd34b2f6ee12dbfc74760e4ed"rel="nofollow" target="_blank" >jsFiddle</a></h2>
<div><a href="http://designmagazine.us?goto=d90b6a9cd34b2f6ee12dbfc74760e4ed"rel="nofollow" target="_blank" ><img class="alignNone size-full wp-image-1611" src="http://designshack.co.uk/wp-content/uploads/fiddlers-3.jpg" alt="Fiddlers-3 in " width="510" /></a></div>
<p>jsFiddle has completely taken off in the past few months to a year and is probably the most popular option on this list at the moment. And for good reason, this is one amazing app. Let&#8217;s face it, once you dig into jsFiddle, you may never look at any of the other options again. </p>
<h3>What I Like About jsFiddle</h3>
<p>There are a ton of great things to cover in my list of reasons why you should use jsFiddle. First up is the layout. There are four panels (HTML, CSS, JavaScript and preview) so you can see everything you need to at once and resize each area on the fly. The layout system here feels really flexible and is actually sort of fun to play with.</p>
<div><img class="alignNone size-full wp-image-1611" src="http://designshack.co.uk/wp-content/uploads/fiddlers-10.jpg" alt="Fiddlers-10 in " width="510" /></div>
<p>While we&#8217;re discussing panels, you can customize the CSS and JavaScript panels to utilize your favorite third party tools. You&#8217;ll find support for the Sass SCSS syntax and CoffeeScript. </p>
<div><img class="alignNone size-full wp-image-1611" src="http://designshack.co.uk/wp-content/uploads/fiddlers-11.jpg" alt="Fiddlers-11 in " width="510" /></div>
<p>jsFiddle lets you create a login and view a dashboard of your past saved work. There are a ton of menu options and tools once you&#8217;ve saved a fiddle, my favorites are the ability to quickly create a fork and the option to automatically tidy up your messy code structure.   </p>
<div><img class="alignNone size-full wp-image-1611" src="http://designshack.co.uk/wp-content/uploads/fiddlers-12.jpg" alt="Fiddlers-12 in " width="510" /></div>
<p>In addition to the panel customization options, the sidebar has a bunch of other great features as well. For instance, you can quickly add both any major libraries that you want to include (jQuery, MooTools, etc.) and your own JavaScript/CSS resources. </p>
<div><img class="alignNone size-full wp-image-1611" src="http://designshack.co.uk/wp-content/uploads/fiddlers-13.jpg" alt="Fiddlers-13 in " width="510" /></div>
<p>One last amazing jsFiddle option that I only just discovered the other day: you can embed fiddles into a webpage. This option is found under the share menu and is a great alternative to other code embedding services.</p>
<h3>What I Don&#8217;t Like About jsFiddle</h3>
<p>My main beef with jsFiddle is the lack of an auto update option for the preview. Once you&#8217;ve used all the other options on this list and experienced the joys of auto update, it&#8217;s hard to put up with manual refreshes every few seconds in jsFiddle.</p>
<p>As far as other features go, it&#8217;s the best on the list but that one annoyance often drives me elsewhere if I just want to bust out a quick test. Keyboard shortcuts help, but they&#8217;re still not as nice as something automatic. </p>
<h2><a href="http://designmagazine.us?goto=fc0aa26284d12157cb1bf2d8f1cdc89f"rel="nofollow" target="_blank" >Dabblet</a></h2>
<div><a href="http://designmagazine.us?goto=fc0aa26284d12157cb1bf2d8f1cdc89f"rel="nofollow" target="_blank" ><img class="alignNone size-full wp-image-1611" src="http://designshack.co.uk/wp-content/uploads/fiddlers-4.jpg" alt="Fiddlers-4 in " width="510" /></a></div>
<p>Dabblet is a fairly new kid on the block in this genre. Like CSSDesk, it focuses on only HTML and CSS with no JavaScript. However, don&#8217;t count it out because it brings some serious innovation to the table that you won&#8217;t find in any other editor. </p>
<h3>What I Like About Dabblet</h3>
<p>By default, Dabblet is split into three tabs: CSS &#038; Result, HTML &#038; Result and Result. This provides flexibility and focus while allowing you to always keep an eye on the result.</p>
<div><img class="alignNone size-full wp-image-1611" src="http://designshack.co.uk/wp-content/uploads/fiddlers-15.jpg" alt="Fiddlers-15 in " width="510" /></div>
<p>You can change things up with the controls shown below. The split can be vertical, horizontal or taken out completely. There&#8217;s also an interesting &#8220;behind code&#8221; mode where your result is simply the background for the coding area. Notice there&#8217;s also a message about using prefix-free. I use Dabblet all the time and never noticed this until just now! This means that you don&#8217;t have to use crazy vendor prefixes and can code the simple defaults, the hidden JavaScript will make sure your browsers interprets it correctly. </p>
<div><img class="alignNone size-full wp-image-1611" src="http://designshack.co.uk/wp-content/uploads/fiddlers-14.jpg" alt="Fiddlers-14 in " width="510" /></div>
<p>Dabblet has some great saving options as well such as &#8220;save anonymously.&#8221; It also links to your GitHub account, which coding nerds like will love. </p>
<div><img class="alignNone size-full wp-image-1611" src="http://designshack.co.uk/wp-content/uploads/fiddlers-16.jpg" alt="Fiddlers-16 in " width="510" /></div>
<p>My favorite Dabblet feature is the super slick hover effect integration in the CSS. They&#8217;re easier to show that describe. Here two few examples:</p>
<div><img class="alignNone size-full wp-image-1611" src="http://designshack.co.uk/wp-content/uploads/fiddlers-17.jpg" alt="Fiddlers-17 in " width="510" /></div>
<p>As you can see, hovering over certain bits of CSS brings up these little tooltips that are really great. You can get previews for fonts, colors, sizes, and even images.</p>
<h3>What I Don&#8217;t Like About Dabblet</h3>
<p>Dabblet is a bit quirky from a visual perspective, you either love it or hate it. I personally really enjoy using it but really wish that I had more control over the panel size. Having an auto 50/50 split is great, but I should be able to manually adjust that however I choose. </p>
<p>As far as I know, there&#8217;s also no way to view your HTML and CSS at the same time, which is a little annoying if you&#8217;re used to options like jsFiddle where you can keep an eye on everything at once. </p>
<h2><a href="http://designmagazine.us?goto=4ec2356e827d1a393e60a9ac6e2e963f"rel="nofollow" target="_blank" >Tinkerbin</a></h2>
<div><a href="http://designmagazine.us?goto=4ec2356e827d1a393e60a9ac6e2e963f"rel="nofollow" target="_blank" ><img class="alignNone size-full wp-image-1611" src="http://designshack.co.uk/wp-content/uploads/fiddlers-5.jpg" alt="Fiddlers-5 in " width="510" /></a></div>
<p>Tinkerbin is the closest alternative to jsFiddle that I&#8217;ve found. Though it doesn&#8217;t have all of the fancy features found in jsFiddle, it has a few tricks of its own that are really nice.</p>
<h3>What I Like About Tinkerbin</h3>
<p>The default panel layout on Tinkerbin is probably my favorite on this entire list. It&#8217;s a very logical layout that puts the code on the left and a nice big auto-updating preview on the right. The HTML, CSS and JavaScript sections are all stacked on top of each other, with optional tabs that allow you to focus on just one of these. </p>
<div><img class="alignNone size-full wp-image-1611" src="http://designshack.co.uk/wp-content/uploads/fiddlers-18.jpg" alt="Fiddlers-18 in " width="510" /></div>
<p>Further, Tinkerbin supports even more alternate syntax options than jsFiddle. You can choose HTML or HAML; CSS, SCSS (with Compass), the old SASS syntax or LESS; and JavaScript or CoffeeScript. Needless to say, if you dig preprocessors, this is the option for you.</p>
<div><img class="alignNone size-full wp-image-1611" src="http://designshack.co.uk/wp-content/uploads/fiddlers-19.jpg" alt="Fiddlers-19 in " width="510" /></div>
<p>Tinkerbin is the only option that allows you to swap out your preview for a nice, extensive &#8220;View Source&#8221; window.</p>
<div><img class="alignNone size-full wp-image-1611" src="http://designshack.co.uk/wp-content/uploads/fiddlers-20.jpg" alt="Fiddlers-20 in " width="510" /></div>
<h3>What I Don&#8217;t Like About Tinkerbin</h3>
<p>Even more so than Dabblet, the Tinkerbin layout is completely rigid. Sure, I like the default setup the best, but sometimes I want to make that preview wider and I simply don&#8217;t have the option here.</p>
<p>Further, the saving options aren&#8217;t the best. There&#8217;s no account setup, dashboard, GitHub integration, etc. You simply save your experiments to a shortened URL. </p>
<h2>Conclusion</h2>
<p>By now I&#8217;m sure you can see the benefits of having a few of these sites bookmarked. I encourage you to experiment as often as possible with new ideas to keep yourself fresh and these services provide an awesome way to do it.</p>
<p>I hope this review has served as a helpful look into the details of each of these solutions. You should now know not only what makes each option unique but also where each falls short. This will help you make an informed decision about which one or two to primarily focus on.</p>
<p>I personally bounce back and forth with all of them fairly regularly but lately I&#8217;ve been hanging out mostly in jsFiddle, Dabblet and Tinkerbin. Which of these is your favorite and why?</p>
<p>Artica Source: <a href="http://designmagazine.us?goto=949a22e086de3f4d8e5ffff04d5a1dec"target="_blank"  title="5 Online Playgrounds for HTML, CSS and JavaScript Compared" rel="nofollow">5 Online Playgrounds for HTML, CSS and JavaScript Compared</a></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://designmagazine.us/5-online-playgrounds-for-html-css-and-javascript-compared/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Call For Better Fragment Identifiers</title>
		<link>http://designmagazine.us/a-call-for-better-fragment-identifiers/</link>
		<comments>http://designmagazine.us/a-call-for-better-fragment-identifiers/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 11:00:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[links]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[Web Design Articles]]></category>
		<category><![CDATA[wide]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wp]]></category>
		<category><![CDATA[year]]></category>
		<category><![CDATA[result]]></category>

		<guid isPermaLink="false">http://designmagazine.us/a-call-for-better-fragment-identifiers/</guid>
		<description><![CDATA[ Where would the web be without links? ]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p> Where would the web be without links? </p>
<p><img src="http://designmagazine.us/wp-content/uploads/2012/02/45709fd413ifiers.jpg.jpg" alt="45709fd413ifiers Jpg in " width="184" height="184" />Where would the web be without links? Links are what hold together what we know as the World Wide Web. Without links, the World Wide Web would be more appropriately called the World Wide Set Of Unrelated Pages, or, incidentally, WWSOUP.</p>
<p>While it&#8217;s great how simple and effective the process is of &#8220;linking&#8221; pages together, I think there&#8217;s room for improvement.</p>
<p>If you&#8217;ve never heard of the term <a href="http://designmagazine.us?goto=10c104a67789fd1a8f67e6f5eacba2bd" rel="nofollow">fragment identifier</a>, well, that&#8217;s just the official name for the part of a URL that follows the hash symbol (&#8220;#&#8221;). Some people refer to links with fragment identifiers as &#8220;in page links&#8221;. So for example, in the following URL, the fragment identifier would be the string &#8220;scroll-to-fragid&#8221;:</p>
<pre name="code">

http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#scroll-to-fragid

</pre>
<p>If you visit the above URL (which is the WHATWG HTML5 spec that discusses fragment identifiers), the page will automatically jump to the section that&#8217;s been identified by the browser as the &#8220;scroll-to-fragid&#8221; section.</p>
<p>Fragment identifiers also come in handy for <a href="http://designmagazine.us?goto=a885c67029d5ee0a184448e87ec7b431" rel="nofollow">deep linking</a> and preserving state in Ajax-based applications. So these certainly have an important role on the web.</p>
<h2>How Are Fragments Identified?</h2>
<p>In order for the browser to correctly identify which section of the page the window should scroll to, the fragment needs to be identified within the HTML by means of the <code>id</code> attribute. This means that if a web developer hasn&#8217;t done his job, then there will be no way to link to a specific fragment of any particular document.</p>
<p>So, if you were linking to a document that was five screens long that didn&#8217;t have any <code>id</code> attributes in the source, and you wanted to link to a specific section three screens down, you would have no way to do this. You&#8217;d have to link to it, then place the words &#8220;Scroll down to section B&#8221; or something ridiculous like that.</p>
<h2>The Problem With Fragment Identifiers</h2>
<p>The simple problem that I see with fragment identifiers is that their existence and functionality relies completely on the developer rather than the browser. Yes, the browser needs to read and interpret the identifier and identify the matching fragment. But if the developer doesn&#8217;t include any <code>id</code> attributes in the HTML of the page, then there will be no identifiable fragments.</p>
<p>Do you see why this is a problem? Whether the developer has coded identifiers into the HTML has nothing to do with whether or not the page actually has fragments. Virtually every web page has fragments. In fact, <a href="http://designmagazine.us?goto=8097d7d04ccbaefaaadbbbb070cf7740" rel="nofollow">sectioning content</a> as defined in the HTML5 spec implies as much. Every element on the page that can contain content can theoretically be categorized as a &#8220;fragment&#8221;.</p>
<p>So why is it up to the developer (or content creator) to define whether or not a specific portion of the content can be linked to? When any page of content is created, there is no way of knowing which sections of the page are worthy of being identified. The developer or content creator may have a general idea of how a page&#8217;s content might be divided up, but ultimately it will be the linking resource that should have full control over what portion of the page they want to highlight.</p>
<p>That, after all, is how linking works. A page that&#8217;s displayed as a result of a web-based hyperlink is displayed to the end user <i>only because</i> the referrer (i.e. the page linking to it) defined the link that way. This means that, regardless of what the developer has done behind the scenes in the HTML, all HTML fragments on that page should be identifiable by external referrers.</p>
<h2>The Solution: Power to the Browser and User</h2>
<p>The solution, as I see it, is for the HTML spec to require that browsers have an internal mechanism for identifying fragments that can optionally be overridden by the developer. Just as the browser, by default, makes all links blue and underlines them, and allows these styles to be changed via CSS, likewise the ability to link to specific sections of a page should be built into the browser, and then the developer should have the option to change this.</p>
<p>Here&#8217;s a simple example of how this might be implemented. Suppose you have the following HTML page:</p>
<pre name="code">
<h1>Page Title</h1>
<p>Some introductory text.</p>

<h2>Page Subhead 1</h2>
<p>Some text for subhead 1.</p>

<h2>Page Subhead 2</h2>
<p>Some text for subhead 2.</p>

<h2>Page Subhead 3</h2>
<p>Some text for subhead 3.</p>

<h2>Page Subhead 4</h2>
<p>Some text for subhead 4.</p>
</pre>
<p>This type of structure is common on almost all blog posts. The post is divided into sections by means of headings, but unless the developer actually hard-codes <code>id</code> attributes onto each heading tag, there is no way to link to any of those unique sections of the page.</p>
<p>To solve this problem, the browser should allow native fragment identifiers that use the HTML elements themselves in a CSS selector-like fashion. So if you wanted to link to &#8220;Page Subhead  3&#8243; in that HTML page, you could do something like this:</p>
<pre name="code">
<a href="http://designmagazine.us?goto=69e0b438ff89b285aca6fce832d67005" rel="nofollow">Check this out!</a>
</pre>
<p>Notice the string <code>h2:3</code> that appears after the hash symbol. This tells the browser to link to the third <code><br />
<h2></code> element on the page. This example, of course, is just theoretical, and not meant to imply that this is the way it will be implemented. This is just to illustrate how it could be done without being dependent on developer-added attributes.</p>
<h2>Why Should Fragments Be Identified By Users?</h2>
<p>The reason fragments should be identifiable by users is because a user, not the content creator or the developer, will ultimately decide whether or not a portion of content is valuable or notable in some way.</p>
<p>Yes, the content creator should have the ability to decide how a page is generally divided, if they choose to do so. But the end user should not be restricted from linking to content fragments just because a developer couldn&#8217;t be bothered to add <code>id</code> attributes to every element on the page. And that&#8217;s besides the fact that it would be a waste of time for a developer to do that or to have to build a CMS that does it automatically.</p>
<h2>Blog Comments Get It Right</h2>
<p>Linking directly to someone&#8217;s blog comment is very useful. Even if a blog doesn&#8217;t have an active link for each comment, it&#8217;s pretty easy to use developer tools to find the comment&#8217;s <code>id</code> and link to it. I&#8217;ve done this many times on <a href="http://designmagazine.us?goto=cffb076560e16fb5ef6c41b2cbc74546" rel="nofollow">Smashing Magazine</a> (they don&#8217;t have live links on each comment).</p>
<p>If there was no way to link to an individual blog comment, this would be a great hindrance to linking on the web. It would not be enough to link to the &#8220;#comments&#8221; section and then hope for the best. So CMSs like WordPress do the right thing by dynamically adding a unique identifier to each comment.</p>
<p>As mentioned, this saves the content creator from having to do it themselves, and puts the identifiability (or, the decision on what&#8217;s valuable) in the hands of the user or the referring website.</p>
<h2>It&#8217;s Already in the Works</h2>
<p>Being fearful of writing an article like this and having someone smarter poke holes in my proposal, I ran a draft of this piece by <a href="http://designmagazine.us?goto=916a30ed66b30b0885ca39ee5c65de54" rel="nofollow">Paul Irish</a> and he pointed out that an improvement to fragment identifiers is already in the works, but in very early stages.</p>
<p>A developer named <a href="http://designmagazine.us?goto=2d6bc19cc4e954f28077a6989eecf269" rel="nofollow">Simon St. Laurent</a> is hosting an &#8220;unofficial draft&#8221; of a specification called <a href="http://designmagazine.us?goto=6268593e747e83290528dd48a7e7488d" rel="nofollow">Using CSS Selectors as Fragment Identifiers</a>. The draft is authored by St. Laurent and <a href="http://designmagazine.us?goto=d9d804bb14ffbd007c5f0b3e2914e7d8" rel="nofollow">Eric Meyer</a> and seems to be in the works for about a year (based on the date on that page). There&#8217;s even <a href="http://designmagazine.us?goto=2cca567633041da08b359abc74647d69" rel="nofollow">a jQuery script</a> that attempts to implement this new type of fragment identifier.</p>
<p>And on a related note, <a href="http://designmagazine.us?goto=d8147979bcff3f213ed47732d13c6a70" rel="nofollow">media fragments</a> (i.e. deep linking in audio and video, similar to <a href="http://designmagazine.us?goto=a2fd6f629fae0cf251380a9a2014cb5f" rel="nofollow">what you can do on YouTube</a>) have now been introduced and have some browser support (evidently WebKit and Firefox). Check out <a href="http://designmagazine.us?goto=2e8c2fc3356d54a2670067f9c9ab0024" rel="nofollow">this part of the spec</a> for the syntax.</p>
<p>All credit to Paul Irish for filling me in on these details.</p>
<h2>Conclusion</h2>
<p>Although implementing better fragment identifiers could be a challenge to support and publicize, for the reasons I&#8217;ve explained here, I think it&#8217;s a worthwhile addition to the HTML/CSS spec. I&#8217;m glad someone is already working on a proposal for this, and I hope this article serves to help make this known so that control of linking to content fragments ends up where it&#8217;s supposed to be: in the hands of users.</p>
<p> <img src="http://www.impressivewebs.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&#038;post_id=5410" width="1" height="1" style="display: none;" alt=" in " />
<p>Related posts:
<ol>
<li><a href="http://designmagazine.us?goto=e27b9d7600142da3e6519c5c2870df3a"  rel="bookmark nofollow" title="Is it Accurate to call HTML5-Based Code Forking “Graceful Degradation”?">Is it Accurate to call HTML5-Based Code Forking &#8220;Graceful Degradation&#8221;?</a></li>
</ol>
<p><a href="http://designmagazine.us?goto=8cec37015b602417d847978ae8523850" rel="nofollow"><img src="http://feedads.g.doubleclick.net/~a/yh3l8yQ0SbrB4KAY-xO0ooRP8BQ/0/di" border="0" ismap="true" alt=" in " /></img></a><br/><br />
<a href="http://designmagazine.us?goto=f3d2dbb06c3090fb55c50de40aa16452" rel="nofollow"><img src="http://feedads.g.doubleclick.net/~a/yh3l8yQ0SbrB4KAY-xO0ooRP8BQ/1/di" border="0" ismap="true" alt=" in " /></img></a></p>
<div>
<a href="http://designmagazine.us?goto=4718dc1621e921d28004338b81517e45" rel="nofollow"><img src="http://feeds.feedburner.com/~ff/ImpressiveWebs?d=yIl2AUoC8zA" border="0" alt=" in " /></img></a> <a href="http://designmagazine.us?goto=a2a23363c1261fd940d9a1515de99d36" rel="nofollow"><img src="http://feeds.feedburner.com/~ff/ImpressiveWebs?i=13KgXqiWN78:ndj7lRcot5Y:D7DqB2pKExk" border="0" alt=" in " /></img></a>
</div>
<p><img src="http://feeds.feedburner.com/~r/ImpressiveWebs/~4/13KgXqiWN78" height="1" width="1" alt=" in " /><br />
Artica Source: <a href="http://designmagazine.us?goto=20eed255d4f5c292c4b4098a9a5fde1d"target="_blank"  title="A Call For Better Fragment Identifiers" rel="nofollow">A Call For Better Fragment Identifiers</a></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://designmagazine.us/a-call-for-better-fragment-identifiers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
