<?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>mFabrik - web and mobile development &#187; jquery</title>
	<atom:link href="http://blog.mfabrik.com/category/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mfabrik.com</link>
	<description>Freedom delivered.</description>
	<lastBuildDate>Thu, 09 Sep 2010 07:16:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>domgen &#8211; Creating HTML with Javascript without DOM API</title>
		<link>http://blog.mfabrik.com/2010/09/02/domgen-creating-html-with-javascript-without-dom-api/</link>
		<comments>http://blog.mfabrik.com/2010/09/02/domgen-creating-html-with-javascript-without-dom-api/#comments</comments>
		<pubDate>Thu, 02 Sep 2010 12:43:41 +0000</pubDate>
		<dc:creator>Jussi Toivola</dc:creator>
				<category><![CDATA[browser]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://blog.mfabrik.com/?p=730</guid>
		<description><![CDATA[Tired of using Javascript DOM API for generating HTML dynamically? Meet domgen. domgen is a tool for easy dynamic content generation via Javascript. It generates DOM elements from dictionary specification similar to HTML and eliminates the need for cumbersome DOM Javascript API. domgen uses a simple specification to generate the HTML. In some cases it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Tired of using Javascript DOM API for generating HTML dynamically? Meet <a href="https://bitbucket.org/mfabrik/domgen">domgen</a>. domgen is a tool for easy dynamic content generation via Javascript. It generates DOM elements from dictionary specification similar to HTML and eliminates the need for cumbersome DOM Javascript API.</p>
<p>domgen uses a simple specification to generate the HTML. In some cases it&#8217;s more reliable to use DOM API to generate HTML instead of using innerHTML. We have had problems especially with iPhone when using innerHTML.<br />
See for example <a href="http://pastebin.com/LLk3J0iH">http://pastebin.com/LLk3J0iH</a> or google &#8220;iPhone innerHTML&#8221; for more info. In fact, innerHTML is not even part of the HTML standard even though it exists on every browser.</p>
<p>So if you want to add dynamic HTML properly, you should use the <a href="http://www.w3schools.com/jsref/dom_obj_all.asp">Javascript DOM API</a>. Consider the following short HTML where the contents inside body had to be generated:</p>
<pre>&lt;body&gt;
    &lt;div id="mydiv"&gt;my div&lt;/div&gt;
&lt;/body&gt;</pre>
<p>Using Javascript DOM API:</p>
<pre>// Get the body tag
var body = document.getElementsByTagName("body")[0];
// Create 'div' element
var mydiv = document.createElement("div");
mydiv.setAttribute("id", "mydiv");
mydiv.innerText = "my div";
// Attach the div to body
body.appendChild(mydiv);</pre>
<p>And using domgen:</p>
<pre>var spec = [
    'div',
    {
        id : 'mydiv',
        _innerText : 'my div'
    }
];
domgen.generate( domgen.get("body")[0], spec);
// or with jQuery
domgen.generate( $("body")[0], spec);</pre>
<p>To me, domgen seems a lot easier to read and work with. Get code and more examples here: <a href="https://bitbucket.org/mfabrik/domgen">https://bitbucket.org/mfabrik/domgen</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mfabrik.com/2010/09/02/domgen-creating-html-with-javascript-without-dom-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a drag&#8217;n&#039;drop basket with jQueryUI</title>
		<link>http://blog.mfabrik.com/2010/01/05/creating-a-dragndrop-basket-with-jqueryui/</link>
		<comments>http://blog.mfabrik.com/2010/01/05/creating-a-dragndrop-basket-with-jqueryui/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 12:53:07 +0000</pubDate>
		<dc:creator>Mikko Ohtamaa</dc:creator>
				<category><![CDATA[jquery]]></category>
		<category><![CDATA[jqueryui]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[basket]]></category>
		<category><![CDATA[cdn]]></category>
		<category><![CDATA[google.code]]></category>
		<category><![CDATA[shopping cart]]></category>
		<category><![CDATA[travel planner]]></category>

		<guid isPermaLink="false">http://blog.twinapex.fi/?p=401</guid>
		<description><![CDATA[I have created an example how to create a &#8220;basked&#8221; with jQuery and jQueryUI with the following features The user can be pick items from the predefined set Items are dragged and dropped to the basket The basket value reflects a hidden input This kind of user interface pattern is suitable for Shopping carts Travel [...]]]></description>
			<content:encoded><![CDATA[<p>I have created an example how to create a &#8220;basked&#8221; with jQuery and jQueryUI with the following features</p>
<ul>
<li>The user can be pick items from the predefined set</li>
<li>Items are dragged and dropped to the basket</li>
<li>The basket value reflects a hidden input</li>
</ul>
<p>This kind of user interface pattern is suitable for</p>
<ul>
<li>Shopping carts</li>
<li>Travel planners</li>
</ul>
<p>The example in fact bears the name &#8220;travel planner&#8221; but it is not tied to travel anyhow.</p>
<p><strong>Note: this is just a screenshot </strong>- please see l<a href="http://blog.twinapex.fi/wp-content/uploads/2010/01/index.html">ive example</a></p>
<p><a href="http://blog.twinapex.fi/wp-content/uploads/2010/01/basket.png"><img class="alignnone size-full wp-image-409" title="basket" src="http://blog.twinapex.fi/wp-content/uploads/2010/01/basket.png" alt="basket" width="500" height="298" /></a></p>
<p>The example code uses</p>
<ul>
<li><a href="http://code.google.com/apis/ajaxlibs/documentation/">google.code() content delivery network</a> to load jQuery and jQueryUI</li>
<li>jQueryUI draggable and droppable features</li>
<li>Well planned visual cues for the drag and drop operations: cursor changes, CSS hover classes</li>
<li>&lt;form&gt; which &lt;input&gt; value is updated according to the basket content &#8211; all selected item ids form a comma separated list</li>
</ul>
<p>The example code is well-documented with links to the further documentation.</p>
<ul>
<li><a href="http://blog.twinapex.fi/wp-content/uploads/2010/01/index.html">Live example</a></li>
<li><a href="http://code.google.com/p/jquerybaskedexample/source/browse/trunk/">View source code</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.mfabrik.com/2010/01/05/creating-a-dragndrop-basket-with-jqueryui/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
