<?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>thedeadone.net &#187; Sajax</title>
	<atom:link href="http://thedeadone.net/tag/sajax/feed/" rel="self" type="application/rss+xml" />
	<link>http://thedeadone.net</link>
	<description></description>
	<lastBuildDate>Tue, 14 Feb 2012 22:06:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>My first AJAX!</title>
		<link>http://thedeadone.net/blog/my-first-ajax/</link>
		<comments>http://thedeadone.net/blog/my-first-ajax/#comments</comments>
		<pubDate>Fri, 20 Jan 2006 10:50:34 +0000</pubDate>
		<dc:creator>Mark Cunningham</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Ars-Magica]]></category>
		<category><![CDATA[MOC]]></category>
		<category><![CDATA[roleplaying]]></category>
		<category><![CDATA[Sajax]]></category>

		<guid isPermaLink="false">http://thedeadone.net/news/my-first-ajax/</guid>
		<description><![CDATA[It is an Enchanted Device Generator for Ars Magica (4th Edition). It&#8217;s built using PHP and Sajax which is a free AJAX toolkit. It&#8217;s been quite an enlightening experiment. The buzz and hype generated around AJAX is quite something, so I thought I&#8217;d give it a shot. I started with an idea, a simple script [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<!--INFOLINKS_ON-->
<p><p>It is an <a href="http://thedeadone.net/moc/wp-content/am-dev/">Enchanted Device Generator for Ars Magica (4th Edition)</a>. It&#8217;s built using PHP and <a href="http://www.modernmethod.com/sajax/">Sajax</a> which is a free AJAX toolkit. </p>
<p>It&#8217;s been quite an enlightening experiment. The buzz and hype generated around AJAX is quite something, so I thought I&#8217;d give it a shot. I started with an idea, a simple script that takes in a few values and does some calculations and presents the result to the user. But, I wanted the user to be able to tweak the values and see the results immediately. That sounds like something AJAX is perfect for.<br />
<span id="more-224"></span><br />
So the first thing I learnt as I started building the script and using Sajax was JavaScript. I used to avoid JavaScript like the plague. I know you can do some funky stuff but in my past experience, JavaScript slows down the user experience and can be very flaky across browsers. Still, what I learned was that I could have easily built my script using just JavaScript. </p>
<p>Yet AJAX would allow me to offload work from the browser to the server. Great, I thought, now I can do the calculations using PHP and just do all the text stuff using JavaScript. The snag I came across was that Sajax treated PHP as an intermediary interface. For example global variables defined in PHP were not accessible when a PHP function was called from JavaScript. Not alone that, only strings could be passed back from PHP. Rich types like arrays are not currently possible. I solved this by doing the calculations once, putting all the values in a string and then passing that string around when calling other PHP functions through Sajax.</p>
<p>It works now and I&#8217;m happy enough. One thing I noticed while I was working away, is that I started thinking about the script more as a User Interface than a webpage. I guess that’s what the hype is really about. All this Web 2.0 silliness. On the other hand, I found it hard to separate the HTML and CSS code and design from the JavaScript and PHP coding. If you look at the script, it&#8217;s very bare. I guess if you treat it like a UI, you&#8217;d do your &#8220;prototype&#8221; first and then add code.</p>
<p>Though I&#8217;ve come to love PHP, I have my reservations. While it&#8217;s a powerful feature to mix html and code, it always bugged me that you can write code that essentially modifies and generates code (in this case HTML, CSS and JavaScript). I guess I&#8217;m old fart but that use to be a no-no in the land of C and ASM (a land I know better than I want). It makes the code unreadable and un-maintainable. And I think often PHP is a little unreadable unless you have a syntax-aware editor or layout your code very well. I&#8217;m one of those &#8216;hardened programmers&#8217; that prefer basic text editors over IDEs (though I&#8217;ve been softened lately by JEdit). Still the idea of using AJAX to create entire UI-like interfaces is a little scary. You really need to think about design of your code to make it maintainable. Still, I like the potential of AJAX and the possible applications on webpage. On the other hand for small ideas, I could just use some JavaScript.
</p>
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://thedeadone.net/blog/finally-i-might-be-able-to-start-playing-again/' title='Finally I might be able to start playing again!'>Finally I might be able to start playing again!</a></li>
<li><a href='http://thedeadone.net/blog/fudge-passions-v02/' title='Fudge Passions v0.2 (a extension for the Fudge RPG system)'>Fudge Passions v0.2 (a extension for the Fudge RPG system)</a></li>
<li><a href='http://thedeadone.net/blog/story-hooks-v02/' title='Story Hooks v0.2 (a roleplaying system to replace backgrounds)'>Story Hooks v0.2 (a roleplaying system to replace backgrounds)</a></li>
<li><a href='http://thedeadone.net/blog/power-driving-in-roleplaying-campaigns-or-why-i-hate-exalted-even-more/' title='Power-Driving in Roleplaying Campaigns (or why I hate Exalted even more)'>Power-Driving in Roleplaying Campaigns (or why I hate Exalted even more)</a></li>
<li><a href='http://thedeadone.net/rpg/from-adventures-to-campaigns-cammys-model-v01/' title='From Adventures to Campaigns&#8230; Cammy&#8217;s Model v0.1'>From Adventures to Campaigns&#8230; Cammy&#8217;s Model v0.1</a></li>
</ul>

<!--INFOLINKS_OFF-->
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://thedeadone.net/blog/my-first-ajax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

