<?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>once upon my code &#187; API</title>
	<atom:link href="http://aefxx.com/tag/api/feed/" rel="self" type="application/rss+xml" />
	<link>http://aefxx.com</link>
	<description></description>
	<lastBuildDate>Thu, 19 Jan 2012 18:40:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>jQote API reference</title>
		<link>http://aefxx.com/api/jqote-reference/</link>
		<comments>http://aefxx.com/api/jqote-reference/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 15:02:03 +0000</pubDate>
		<dc:creator>aefxx</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[jQote]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://onceupon.com/?p=126</guid>
		<description><![CDATA[PLEASE NOTE:
jQote2 has been released. Please consider upgrading now!!! Click here for a quick summary of what&#8217;s new and what&#8217;s changed.
jQote allows you to operate on a single template as well as a collection of templates. Any template you call jQote upon will get converted using the data object you provide.
Note: Since objects are passed [...]]]></description>
			<content:encoded><![CDATA[<h3 class="pink">PLEASE NOTE:</h3>
<p class="pink"><strong>jQote2</strong> has been released. Please consider upgrading now!!! <a href="http://aefxx.com/jquery-plugins/jqote2/">Click here</a> for a quick summary of what&#8217;s new and what&#8217;s changed.</p>
<p>jQote allows you to operate on a single template as well as a collection of templates. Any template you call jQote upon will get converted using the data object you provide.</p>
<p><span id="more-126"></span>Note: Since objects are passed by reference you may easily alter the data object inside a template and have these changes carried over to the next iteration.</p>
<p>To make your life easier you may just as well pass an array of data objects to jQote to have your template(s) iterate over every data object provided, thus inducing n x m conversions.</p>
<h2>$.jqote_tag(tag) <span class="grey small">: method</span></h2>
<p><span class="grey">This may be used to change the default start- and ending tag character from <code>%</code> to anything you want to. Be aware that changing the tag&#8217;s char(s) this way every successive call to jQote expects the templates to be compliant to the newly set default.</span></p>
<h3>Returns</h3>
<pre class="code">void</pre>
<h3>Parameters</h3>
<pre class="code"><span class="blue">tag</span> : String</pre>
<p></p>
<h2>$().jqote(data[, tag]) <span class="grey small">: function</span></h2>
<p><span class="grey">Inside your templates you may use the <code>this</code> keyword to reference the data object&#8217;s properties. Additionally two counting variables <code>i</code> and <code>j</code> are defined (the former iterating over your templates, the latter iterating over your data objects).</span><br />
<br />
<span class="grey">You may use the optional second paramter to temporarily specify different start- and ending tag char(s). The change will overwrite the default tag char(s) just for the single call!</span></p>
<h3>Returns</h3>
<pre class="code"><span class="blue">jQuery</span> : object</pre>
<h3>Parameters</h3>
<pre class="code"><span class="blue">data</span> : object | array of object</pre>
<pre class="code"><span class="blue">tag</span> : String (optional)</pre>
<p></p>
<h3>Example</h3>
<p class="grey" style="margin: 0; padding: 0;">The infamous and obligatory &#8220;Hello World&#8221; &#8230;</p>
<p class="grey">Notice that this temporarily uses a different start- and ending tag char (the * star)!!!</p>
<pre class="code">&lt;p id="greet">&lt;/p>

&lt;script type="text/html" id="tmpl">
    &lt;![CDATA[
    I said &lt;strong><span class="blue">&lt;*= this.what *></span>&lt;/strong> !!!
    ]]&gt;
&lt;/script>
</pre>
<pre class="code">&lt;script type="text/javascript"&gt;
    <span class="grey">// let's do some jQote magic</span>
    <span class="blue">$('#tmpl').jQuote({what: 'Hello World'}, '*')</span>.appendTo($('#greet'));
&lt;/script&gt;</pre>
<div class="result">
<p id="greet">I said <strong>Hello World</strong> !!!
</div>
<p></p>
<h3>Example</h3>
<p class="grey" style="margin: 0; padding: 0;">This example will list some names of european capitals &#8230;</p>
<pre class="code">&lt;ul id="capitals"&gt;&lt;ul&gt;

<span class="grey">&lt;!-- let's define our city template --&gt;</span>
&lt;script type="text/html" id="city_tmpl"&gt;
    &lt;![CDATA[
    &lt;li class="city"&gt;
        <span class="blue">&lt;%= this.name %&gt;
        &lt;% if ( this.info ) { %&gt;</span>
        &lt;ul class="info"&gt;
            <span class="blue">&lt;% for ( key in this.info) %&gt;</span>
            &lt;li&gt;<span class="blue">&lt;%= key + ': ' +  this.info[key] %&gt;</span>&lt;/li&gt;
            <span class="blue">&lt;% ; %&gt;</span>
        &lt;/ul&gt;
        <span class="blue">&lt;% } %&gt;</span>
    &lt;/li&gt;
    ]]&gt;
&lt;/script&gt;</pre>
<pre class="code">&lt;script type="text/javascript"&gt;
    var cities = [{
        name: 'Paris',
        info: { language: 'french', sight: 'tour Eiffel' }
    }, {
        name: 'Berlin',
        info: { language: 'german', sight: 'Brandenburger Tor' }
    }];

    <span class="grey">// let's do some jQote magic</span>
    <span class="blue">$('#city_tmpl').jQuote(cities)</span>.appendTo($('#capitals'));
&lt;/script&gt;</pre>
<div class="result">
<ul>
<li>Paris
<ul>
<li>language: french</li>
<li>sight: tour Eiffel</li>
</ul>
</li>
<li>Berlin
<ul>
<li>language: german</li>
<li>sight: Brandenburger Tor</li>
</ul>
</li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://aefxx.com/api/jqote-reference/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
	</channel>
</rss>

