TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Javascript, AJAX, E4X (http://www.talkphp.com/javascript-ajax-e4x/)
-   -   Spry - The new kid at school (http://www.talkphp.com/javascript-ajax-e4x/1472-spry-new-kid-school.html)

CMellor 11-15-2007 02:30 PM

Spry - The new kid at school
 
Ok, lame title, but you know when you were at school at you got a new kid come in and he didn't speak a word for like a week? That's kind of what Spry is like, in my opinion. I'm sure most people who read this will know about Frameworks, like Prototype and jQuery... but theirs another, which appears to be quite unknown in the community, at least I think so anyway.

Spry was made by Adobe. Now I believe I heard in an interview from the lead developer of Dreamweaver CS3 on the heels of it's release date that they wanted to incorporate a framework into there new upgrade of Dreamweaver, but they couldn't find one that fit to there needs, so... they made there own! Spry was born. I was interested in this because it was one of those things that made AJAX simple to use. I hated coding AJAX in the "traditional" way, and wanted something simple and x-browser, but I didn't know there was a lot more to it than making easy AJAX calls.

It's made up of three parts:
  • Data - using HTML, JSON and XML
  • Widgets - tabbed panels, Accordion and more
  • Effects - your typical effects library, you'd find in most, like script.aculo.us
With Spry, you can take an XML file and make a data set constructor and output the XML in a very easy format, like so:

html Code:
<script>
   var ds1 = new Spry.Data.XMLDataSet("folder/products.xml","products/product");
</script>

<div spry:region="ds1"> {ds1::name}</div>

That is a Spry region, which is basically like a loop. Spry let's you add new attributes to code, like seen above, as well as a region, there are plenty more to choose from, you can even do an if statement

html Code:
<div spry:region="ds1 ds2">
   <span spry:if="{name} == 'Photoshop'">{name}{ds2::name}</span>
 </div>
Now this isn't a big article on how to use Spry, I'm just making it known that it exists, and as a web developer, you should at least check it out, because who knows? you may find something useful out of it.

Here are some links you can check out, they have a very good and clear documentation and samples of what Spry can do.

Spry documentation
Spry starting guide
Spry examples

The above links cover everything in Spry, and it's easy to understand and use, so check it out, maybe whip something up, and if you want, let us know what you think of it.


All times are GMT. The time now is 06:23 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0