<?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>trentacular &#187; javascript</title>
	<atom:link href="http://trentacular.com/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://trentacular.com</link>
	<description>Trent Foley's Spectacular Technical Blog</description>
	<lastBuildDate>Thu, 15 Apr 2010 21:32:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Avoiding SOAP Bloat with JSON Services</title>
		<link>http://trentacular.com/2010/04/avoiding-soap-bloat-with-json-services/</link>
		<comments>http://trentacular.com/2010/04/avoiding-soap-bloat-with-json-services/#comments</comments>
		<pubDate>Thu, 15 Apr 2010 20:36:12 +0000</pubDate>
		<dc:creator>Trent</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[wcf]]></category>
		<category><![CDATA[asp.net 3.5]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[soap]]></category>
		<category><![CDATA[visual studio 2010]]></category>
		<category><![CDATA[web services]]></category>

		<guid isPermaLink="false">http://trentacular.com/?p=290</guid>
		<description><![CDATA[In this post I am going to walk through writing and consuming JSON services using ASP.Net, WCF, and jQuery to request the stock price for a company.
Visual Studio 2010 Web Application Project Template Additions

jQuery Intellisense – let Visual Studio write your jQuery for you
AJAX-enabled WCF Service – item template that auto-generates the web.config entries for [...]]]></description>
			<content:encoded><![CDATA[<p>In this post I am going to walk through writing and consuming JSON services using ASP.Net, WCF, and jQuery to request the stock price for a company.</p>
<h4>Visual Studio 2010 Web Application Project Template Additions</h4>
<ul>
<li>jQuery Intellisense – let Visual Studio write your jQuery for you</li>
<li>AJAX-enabled WCF Service – item template that auto-generates the web.config entries for configuring a JSON service to be consumed and proxied by an ASP.Net ScriptManager</li>
<li>Targeted web.config files – easy way to manage different service endpoints for different environments</li>
</ul>
<h4>What is JSON?</h4>
<p>Java Script Object Notation &#8211; JSON is a subset of the object literal notation of JavaScript. Since JSON is a subset of JavaScript, it can be used in the language with no muss or fuss.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> dog <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>color<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;grey&quot;</span><span style="color: #339933;">,</span> <span style="color: #000066;">name</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Spot&quot;</span><span style="color: #339933;">,</span> size<span style="color: #339933;">:</span> <span style="color: #CC0000;">46</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></div></div>

<h4>SOAP Bloat</h4>
<p>SOAP services are extremely verbose. This verbosity enables us to use tools like Visual Studio’s built-in ”Add Service Reference” to auto-generate client proxy classes.  The following examples demonstrate the XML that is used for requesting a stock price and the corresponding response:</p>
<p>Example SOAP Request</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;soap:Envelope</span> <span style="color: #000066;">xmlns:soap</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/12/soap-envelope&quot;</span> <span style="color: #000066;">soap:encodingStyle</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/12/soap-encoding&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;soap:Body</span> <span style="color: #000066;">xmlns:m</span>=<span style="color: #ff0000;">&quot;http://www.example.org/stock&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;m:GetStockPrice<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;m:StockName<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>GOOG<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/m:StockName<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/m:GetStockPrice<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/soap:Body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/soap:Envelope<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Example SOAP Response</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;soap:Envelope</span> <span style="color: #000066;">xmlns:soap</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/12/soap-envelope&quot;</span> <span style="color: #000066;">soap:encodingStyle</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/12/soap-encoding&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;soap:Body</span> <span style="color: #000066;">xmlns:m</span>=<span style="color: #ff0000;">&quot;http://www.example.org/stock&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;m:GetStockPriceResponse<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;m:Price<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>534.5<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/m:Price<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/m:GetStockPriceResponse<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/soap:Body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/soap:Envelope<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>The above example when formatted as JSON is as follows:</p>
<p>GET Request</p>
<pre>ticker=GOOG</pre>
<p>JSON Response</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">&quot;d&quot;</span><span style="color: #339933;">:</span><span style="color: #CC0000;">534.5</span><span style="color: #009900;">&#125;</span></pre></div></div>

<h4>JSON Enabling a WCF Service</h4>
<ol>
<li>Using the AJAX-enabled WCF Service item template pretty much does it all.  An additional step can be taken to eliminate the need for the additions to the web.config by configuring the channel factory directly on the service declaration (.svc) file:

<div class="wp_syntax"><div class="code"><pre class="asp" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;%</span><span style="color: #006600; font-weight: bold;">@</span> ServiceHost Language<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;C#&quot;</span> Debug<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;true&quot;</span>
    Service<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;Trentacular.JsonWcfDemo.StockPriceService&quot;</span>
    Factory<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;System.ServiceModel.Activation.WebScriptServiceHostFactory&quot;</span>
    CodeBehind<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;StockPriceService.svc.cs&quot;</span> <span style="color: #000000; font-weight: bold;">%&gt;</span></pre></div></div>

</li>
<li>Decorate the operation (service method) with the WebGetAttribute to enable the use of HTTP GET for data retrieval and return the response as JSON :

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #000000;">&#91;</span>WebGet<span style="color: #000000;">&#40;</span>ResponseFormat <span style="color: #008000;">=</span> WebMessageFormat.<span style="color: #0000FF;">Json</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span></pre></div></div>

</li>
</ol>
<p>Our resulting stock price service’s code behind will look like the following:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">    <span style="color: #000000;">&#91;</span>ServiceContract<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">Namespace</span> <span style="color: #008000;">=</span> JsonWcfDemoNamespace.<span style="color: #0000FF;">Value</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
    <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">class</span> StockPriceService
    <span style="color: #000000;">&#123;</span>
        <span style="color: #008080; font-style: italic;">// To use HTTP GET, add [WebGet] attribute. (Default ResponseFormat is WebMessageFormat.Json)</span>
        <span style="color: #008080; font-style: italic;">// To create an operation that returns XML,</span>
        <span style="color: #008080; font-style: italic;">//     add [WebGet(ResponseFormat=WebMessageFormat.Xml)],</span>
        <span style="color: #008080; font-style: italic;">//     and include the following line in the operation body:</span>
        <span style="color: #008080; font-style: italic;">//         WebOperationContext.Current.OutgoingResponse.ContentType = &quot;text/xml&quot;;</span>
        <span style="color: #000000;">&#91;</span>OperationContract<span style="color: #000000;">&#93;</span>
        <span style="color: #000000;">&#91;</span>WebGet<span style="color: #000000;">&#40;</span>ResponseFormat<span style="color: #008000;">=</span>WebMessageFormat.<span style="color: #0000FF;">Json</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
        <span style="color: #0600FF;">public</span> StockPrice GetStockPrice<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> ticker<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            ...
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #008080; font-style: italic;">// Add more operations here and mark them with [OperationContract]</span>
    <span style="color: #000000;">&#125;</span></pre></div></div>

<h4>Converting Text to JSON and Back</h4>
<p><strong>eval()</strong> &#8211; invokes the JavaScript compiler. The compiler will correctly parse the text and produce an object structure. The eval function is very fast. However, it can compile and execute any JavaScript program, so there can be security issues.</p>
<p><strong>JSON.parse()</strong> &#8211; To defend against security issues with the eval function, it is preferred to use a JSON parser. A JSON parser will recognize only JSON text, rejecting all scripts. In browsers that provide native JSON support, JSON parsers are also much faster than eval. It is expected that native JSON support will be included in the next ECMAScript standard.</p>
<h4>jQuery’s $.getJSON() Method</h4>
<p>jQuery provides the getJSON method for easily making calls to services providing JSON-formatted responses and performing the JSON conversion.  Its signature is as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$.<span style="color: #660066;">getJSON</span><span style="color: #009900;">&#40;</span> url<span style="color: #339933;">,</span> <span style="color: #009900;">&#91;</span> data <span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#91;</span> callback<span style="color: #009900;">&#40;</span>data<span style="color: #339933;">,</span> textStatus<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span></pre></div></div>

<p>url &#8211; A string containing the URL to which the request is sent.</p>
<p>data &#8211; A map or string that is sent to the server with the request.</p>
<p>callback(data, textStatus) &#8211; A callback function that is executed if the request succeeds.</p>
<p>Consuming our stock price service using the getJSON method will look like the following:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$.<span style="color: #660066;">getJSON</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;StockPriceService.svc/GetStockPrice&quot;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> ticker<span style="color: #339933;">:</span> tickerValue <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>data<span style="color: #339933;">,</span> textStatus<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>textStatus <span style="color: #339933;">!=</span> <span style="color: #3366CC;">'success'</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span>data.<span style="color: #660066;">d</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#stockPricePanel&quot;</span><span style="color: #009900;">&#41;</span>
            .<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;span class=&quot;error&quot;&gt;Error looking up stock price.  Did you enter a valid ticker?&lt;/span&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003366; font-weight: bold;">var</span> stockPrice <span style="color: #339933;">=</span> data.<span style="color: #660066;">d</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> isIncrease <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>stockPrice.<span style="color: #660066;">Delta</span> <span style="color: #339933;">&gt;=</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> deltaStyle <span style="color: #339933;">=</span> isIncrease <span style="color: #339933;">?</span> <span style="color: #3366CC;">'gain'</span> <span style="color: #339933;">:</span> <span style="color: #3366CC;">'loss'</span><span style="color: #339933;">;</span>
&nbsp;
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#stockPricePanel&quot;</span><span style="color: #009900;">&#41;</span>
            .<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;span class=&quot;price&quot;&gt;'</span> <span style="color: #339933;">+</span> stockPrice.<span style="color: #660066;">Price</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&lt;/span&gt;'</span><span style="color: #009900;">&#41;</span>
            .<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;span class=&quot;delta '</span> <span style="color: #339933;">+</span> deltaStyle <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&quot;&gt;'</span> <span style="color: #339933;">+</span> stockPrice.<span style="color: #660066;">Delta</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&lt;/span&gt;'</span><span style="color: #009900;">&#41;</span>
            .<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;span class=&quot;percent '</span> <span style="color: #339933;">+</span> deltaStyle <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&quot;&gt;('</span> <span style="color: #339933;">+</span> stockPrice.<span style="color: #660066;">PercentChange</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'%)&lt;/span&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h4>Working with WCF Serialized JSON Dates</h4>
<p>One caveat when working with JSON is that WCF serializes DateTimes to JSON in the format:</p>
<p>/Date({milliseconds since 01/01/1970}-{time zone})/</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://trentacular.com/wp-content/uploads/2010/04/image.png" border="0" alt="image" width="640" height="188" /><br />
Unfortunately, native JSON conversion does not automatically convert the date string to a JavaScript date object.  The following method shows an example of how to convert a JSON date string to a javascript Date object:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> convertJSONToDate<span style="color: #009900;">&#40;</span>json<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">eval</span><span style="color: #009900;">&#40;</span>json.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/\/Date\((.*?)\)\//gi</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;new Date($1)&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h4>Download the Demo Application</h4>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://trentacular.com/wp-content/uploads/2010/04/image1.png" border="0" alt="image" width="640" height="195" /><br />
<a href="/wp-content/uploads/2010/04/Trentacular.JsonWcfDemo.zip"><img src="/wp-content/uploads/2010/04/download.png" alt="Download Now" title="Download Now" /></a> <a href="/wp-content/uploads/2010/04/Trentacular.JsonWcfDemo.zip" title="Download Now">Download Now</a></p>
]]></content:encoded>
			<wfw:commentRss>http://trentacular.com/2010/04/avoiding-soap-bloat-with-json-services/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Galleriffic 2.0</title>
		<link>http://trentacular.com/2009/10/galleriffic-2-0/</link>
		<comments>http://trentacular.com/2009/10/galleriffic-2-0/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 16:05:45 +0000</pubDate>
		<dc:creator>Trent</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[photo gallery]]></category>

		<guid isPermaLink="false">http://trentacular.com/?p=184</guid>
		<description><![CDATA[Say hello to Galleriffic 2.0.
For first time readers, Galleriffic is a jQuery photo gallery optimized to handle high volumes of photos while conserving bandwidth.   h0bbel has posted a nice read on some of the benefits of Galleriffic over other photo gallery scripts.
New Features

Keyboard Navigation
Support for synchronized transitions (image cross-fades)
Ability to add or remove images [...]]]></description>
			<content:encoded><![CDATA[<p>Say hello to <a title="Galleriffic" href="http://www.twospy.com/galleriffic/index.html">Galleriffic 2.0</a>.</p>
<p>For first time readers, <a title="Galleriffic" href="http://www.twospy.com/galleriffic/index.html">Galleriffic</a> is a jQuery photo gallery optimized to handle high volumes of photos while conserving bandwidth.   <a href="http://h0bbel.p0ggel.org/why-do-most-jquery-gallery-plugins-suck-your-bandwidth-dry">h0bbel</a> has posted a <a href="http://h0bbel.p0ggel.org/why-do-most-jquery-gallery-plugins-suck-your-bandwidth-dry">nice read</a> on some of the benefits of Galleriffic over other photo gallery scripts.</p>
<h4>New Features</h4>
<ul>
<li>Keyboard Navigation</li>
<li>Support for synchronized transitions (image cross-fades)</li>
<li>Ability to add or remove images after the gallery is initialized</li>
<li>Support for custom hash identifiers (when using history)</li>
<li>Better API to make it easier to customize</li>
<li>Smarter pagination</li>
<li>Integration with the jquery.history plugin for history support</li>
</ul>
<h4>Warnings to users attempting to upgrade from version 1.0</h4>
<ul>
<li>The onChange event in 1.0 has been renamed to onSlideChange.</li>
<li>All transition event handlers have new signatures, so you will need to make sure to update any transition event handlers you have implemented.</li>
<li>Using synchronized transitions requires changes to your stylesheet &#8211; primarily the additional of relative and absolutely positioning so that two images can occupy the same space at the same time.</li>
</ul>
<p>There are now 5 examples, each builds on the previous.  For a visual treat, check out <a title="Galleriffic Visual Treat Example" href="http://www.twospy.com/galleriffic/example-5.html">the last example</a>, whose colors I inverted.</p>
]]></content:encoded>
			<wfw:commentRss>http://trentacular.com/2009/10/galleriffic-2-0/feed/</wfw:commentRss>
		<slash:comments>485</slash:comments>
		</item>
		<item>
		<title>Using jQuery with ASP.Net Demo Web site</title>
		<link>http://trentacular.com/2009/07/using-jquery-with-asp-net-demo-web-site/</link>
		<comments>http://trentacular.com/2009/07/using-jquery-with-asp-net-demo-web-site/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 20:34:14 +0000</pubDate>
		<dc:creator>Trent</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[ajax history]]></category>
		<category><![CDATA[autocomplete]]></category>
		<category><![CDATA[facebox]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[modal dialog]]></category>

		<guid isPermaLink="false">http://trentacular.com/?p=150</guid>
		<description><![CDATA[I was recently asked to demonstrate how to use jQuery with ASP.Net, with a focus on AJAX.  So I spent a few hours and cooked up this demo web site.
The Web site demonstrates the following jQuery concepts:

Basic jQuery selectors and API usage
Wiring up javascript event handlers with jQuery
AJAX autocomplete textbox using the Autocomplete plugin
Maintaining AJAX [...]]]></description>
			<content:encoded><![CDATA[<p>I was recently asked to demonstrate how to use jQuery with ASP.Net, with a focus on AJAX.  So I spent a few hours and cooked up this demo web site.</p>
<p>The Web site demonstrates the following jQuery concepts:</p>
<ul>
<li>Basic jQuery selectors and API usage</li>
<li>Wiring up javascript event handlers with jQuery</li>
<li>AJAX autocomplete textbox using the <a href="http://www.pengoworks.com/workshop/jquery/autocomplete.htm">Autocomplete plugin</a></li>
<li>Maintaining AJAX navigation history and state using the <a href="http://www.mikage.to/jquery/jquery_history.html">History plugin</a></li>
<li>Loading dynamic html into a panel using the jQuery.load API function</li>
<li>Loading dynamic html into a modal dialog using the <a href="http://famspam.com/facebox">FaceBox plugin</a></li>
</ul>
<p>The demo could be useful to both someone starting out with jQuery or an old-timer looking for some new AJAX approaches.  Let me know what you think.</p>
<h4>Download</h4>
<p><a href="/wp-content/uploads/2009/07/asp.net-jQuery-demo.zip">asp.net-jQuery-demo.zip</a><br />
(Requires Visual Studio 2008 and the .Net Framework 3.5)</p>
<h4>Preview</h4>
<p><object width="640" height="505"><param name="movie" value="http://www.youtube.com/v/lPvkb_1zJWc&#038;hl=en&#038;fs=1&#038;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/lPvkb_1zJWc&#038;hl=en&#038;fs=1&#038;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="505"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://trentacular.com/2009/07/using-jquery-with-asp-net-demo-web-site/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Galleriffic 1.0</title>
		<link>http://trentacular.com/2009/02/galleriffic-1-0/</link>
		<comments>http://trentacular.com/2009/02/galleriffic-1-0/#comments</comments>
		<pubDate>Wed, 04 Feb 2009 04:38:37 +0000</pubDate>
		<dc:creator>Trent</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[photo gallery]]></category>

		<guid isPermaLink="false">http://trentacular.com/?p=86</guid>
		<description><![CDATA[*************************************************************
Update: Galleriffic 2.0 has been released.  Read about it here.
*************************************************************
At long last, I have released the 1.0 version of Galleriffic, which packs all sorts of new features.
For first time readers, Galleriffic is a jQuery photo gallery optimized to handle high volumes of photos while conserving bandwidth.  h0bbel has posted a nice read on [...]]]></description>
			<content:encoded><![CDATA[<p>*************************************************************</p>
<p><strong>Update</strong>: <a href="http://trentacular.com/2009/10/galleriffic-2-0/">Galleriffic 2.0</a> has been released.  Read about it <a href="http://trentacular.com/2009/10/galleriffic-2-0/">here</a>.</p>
<p>*************************************************************</p>
<p>At long last, I have released the <a title="Galleriffic" href="http://www.twospy.com/galleriffic/index.html">1.0 version of Galleriffic</a>, which packs all sorts of new features.</p>
<p>For first time readers, <a title="Galleriffic" href="http://www.twospy.com/galleriffic/index.html">Galleriffic</a> is a jQuery photo gallery optimized to handle high volumes of photos while conserving bandwidth.  <a href="http://h0bbel.p0ggel.org/why-do-most-jquery-gallery-plugins-suck-your-bandwidth-dry">h0bbel</a> has posted a <a href="http://h0bbel.p0ggel.org/why-do-most-jquery-gallery-plugins-suck-your-bandwidth-dry">nice read</a> on some of the benefits of Galleriffic over other photo gallery scripts.</p>
<h3>New Features</h3>
<ul>
<li>Updated to work with jQuery 1.3 (apparently jQuery 1.3.2 introduces a flicker the gallery advances)</li>
<li>OnTransitionIn and OnTransitionOut events that allow for plugging in custom transitions</li>
<li>SlideShow auto start option</li>
<li>Disable history and url hash writing option</li>
<li>Support for showing an element (such as an animated loading image) when waiting for an image to load</li>
<li>Thumbnails are now simply shown/hidden instead of being rebuilt which allows for any custom html to be used as a thumbnail</li>
<li>Replaced invalid html attributes &#8220;description&#8221; and &#8220;original&#8221; with an optional caption element that can contain any custom html</li>
<li>Changed the toggle slideshow span to a hyperlink</li>
</ul>
<p>By exposing both image and page transition events, the doors of creativity are now open for plugging in your own image transitions.  This should also lend to a more modular approach for extending Galleriffic.</p>
<h3>FAQ</h3>
<h4>Will Galleriffic generate the slide and thumbnail images automatically?</h4>
<p>I have been asked a lot if Galleriffic automatically generates the thumbnails and slides.</p>
<p>Galleriffic by itself does <strong>not</strong> do any image processiong or generation; however, there is a great tool that does: <a title="jAlbum" href="http://jalbum.net">jAlbum</a>.  I have created a <a title="Galleriffic jAlbum Skin" href="http://jalbum.net/skins/skin/Galleriffic">jAlbum skin</a> that I use myself for creating my personal galleries.  After installing jAlbum and the Galleriffic jAlbum skin, simply choose your source image directory and an output directory, click &#8220;Make Album&#8221;, and wallah, you now have a complete html gallery with 3 different size versions of each image.</p>
<h4>How can I center the slide image?</h4>
<p>Thanks to Cristi for providing a solution to this problem.  <a href="#comment-367">Click here to read her solution</a>.</p>
<h4>How can I change the number of thumbnail columns?</h4>
<p>With the stylesheet used in the example, each thumbnail is floated left, and thus as many thumbnails that will fit in the width of the column will be displayed.  If you want fewer or more columns, make the width of the navigation panel smaller or larger.  I am currently setting its width using javascript with the following line in the html:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span>”
<span style="color: #339933;">&lt;!--</span> div.<span style="color: #660066;">navigation</span><span style="color: #009900;">&#123;</span>width<span style="color: #339933;">:</span>300px<span style="color: #339933;">;</span>float<span style="color: #339933;">:</span> left<span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>div.<span style="color: #660066;">content</span><span style="color: #009900;">&#123;</span>display<span style="color: #339933;">:</span>block<span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span> <span style="color: #339933;">--&gt;</span>
&nbsp;
”<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>It has been pointed out in the comments that a better way to do this is to use the jQuery.css() method just before initializing the gallery.</p>
<h4>Where do I submit my issues or enhancement requests?</h4>
<p>I started an <a href="http://code.google.com/p/galleriffic/issues/list">issues list</a> that I will start working off of for future releases <a href="http://code.google.com/p/galleriffic/issues/list">here</a>.  Submit your issues and enhancement requests in this list.</p>
]]></content:encoded>
			<wfw:commentRss>http://trentacular.com/2009/02/galleriffic-1-0/feed/</wfw:commentRss>
		<slash:comments>427</slash:comments>
		</item>
		<item>
		<title>Galleriffic JQuery Plugin</title>
		<link>http://trentacular.com/2008/09/galleriffic-jquery-plugin/</link>
		<comments>http://trentacular.com/2008/09/galleriffic-jquery-plugin/#comments</comments>
		<pubDate>Mon, 15 Sep 2008 23:56:26 +0000</pubDate>
		<dc:creator>Trent</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[photo gallery]]></category>

		<guid isPermaLink="false">http://trentacular.com/?p=5</guid>
		<description><![CDATA[UPDATE: Version 1.0 is now available.  Read about it here.
Galleriffic is a dynamic photo gallery optimized to handle a high volume of photos. I would love feedback on how to improve this plugin.
02/03/2009 Update: Released v 1.0

Read up on 1.0 release in this post.

10/05/2008 Update: Released v 0.7

Added support for multiple galleries per page
New 0.7 jAlbum [...]]]></description>
			<content:encoded><![CDATA[<p>UPDATE: Version 1.0 is now available.  Read about it <a title="Galleriffic 1.0" href="http://trentacular.com/2009/02/galleriffic-1-0/">here</a>.</p>
<p>Galleriffic is a dynamic photo gallery optimized to handle a high volume of photos. I would love feedback on how to improve this plugin.</p>
<p>02/03/2009 Update: <a title="Galleriffic 1.0" href="http://trentacular.com/2009/02/galleriffic-1-0/">Released v 1.0</a></p>
<ul>
<li>Read up on 1.0 release in this <a title="Galleriffic 1.0" href="http://trentacular.com/2009/02/galleriffic-1-0/">post</a>.</li>
</ul>
<p>10/05/2008 Update: Released v 0.7</p>
<ul>
<li>Added support for multiple galleries per page</li>
<li>New 0.7 jAlbum skin release</li>
</ul>
<p>9/30/2008 Update: Released v 0.6</p>
<ul>
<li>Now supports graceful degradation (see <a title="Galleriffic JQuery Plugin" href="http://www.twospy.com/galleriffic/index.html">example</a> for updated instructions on how to set up your gallery)</li>
<li>Added configuration option to specify the number of slides to preload in advance</li>
</ul>
<p>9/25/2008 Update: Released v 0.5</p>
<ul>
<li>Replaced several lingering hardcoded titles and link text with settings values to allow for internationalization</li>
<li>Updated the jAlbum skin</li>
</ul>
<p>9/20/2008 Update: Released v 0.4</p>
<ul>
<li>Added support for onFadeOut and onFadeIn events (see example for how this can be used)</li>
<li>Removed unnecessary iframe that is created when using IE</li>
<li>Released a new <a href="http://jalbum.net/skins/skin/Galleriffic">jAlbum skin</a> that makes creating static albums a breeze (<a title="Galleriffic jAlbum Skin Demo" href="http://www.twospy.com/galleriffic/demo/index.html">View the demo</a>)</li>
</ul>
<p>9/17/2008 Update: Released v 0.3</p>
<ul>
<li>Implemented additional options for title and description element selectors</li>
<li>To enable the &#8216;Download Link&#8217;, a link element selector is now needed</li>
</ul>
<p>9/16/2008 Update: Released v 0.2</p>
<ul>
<li>Reworked image preloading to load a single image at a time</li>
</ul>
<p><a title="Galleriffic JQuery Plugin" href="http://www.twospy.com/galleriffic/index.html"><img title="Screenshot" src="http://www.twospy.com/galleriffic/ss-01.jpg" alt="Screenshot" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://trentacular.com/2008/09/galleriffic-jquery-plugin/feed/</wfw:commentRss>
		<slash:comments>54</slash:comments>
		</item>
	</channel>
</rss>
