<?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>Sixteen Small Stones &#187; programming</title>
	<atom:link href="http://www.sixteensmallstones.org/keyword/programming/feed" rel="self" type="application/rss+xml" />
	<link>http://www.sixteensmallstones.org</link>
	<description>The Weblog of J. Max Wilson</description>
	<lastBuildDate>Thu, 02 Feb 2012 23:50:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com" />
	<atom:link rel="hub" href="http://superfeedr.com/hubbub" />
			<item>
		<title>IE JavaScript Bugs: Overriding Internet Explorer&#8217;s document.getElementById() To Be W3C Compliant Exposes An Additional Bug In getAttributes()</title>
		<link>http://www.sixteensmallstones.org/ie-javascript-bugs-overriding-internet-explorers-documentgetelementbyid-to-be-w3c-compliant-exposes-an-additional-bug-in-getattributes</link>
		<comments>http://www.sixteensmallstones.org/ie-javascript-bugs-overriding-internet-explorers-documentgetelementbyid-to-be-w3c-compliant-exposes-an-additional-bug-in-getattributes#comments</comments>
		<pubDate>Fri, 16 Nov 2007 20:13:00 +0000</pubDate>
		<dc:creator>J. Max Wilson</dc:creator>
				<category><![CDATA[technology]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[getattribute()]]></category>
		<category><![CDATA[getelementbyid()]]></category>
		<category><![CDATA[ie7]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[It&#8217;s time for another technical article. Those of my readers who aren&#8217;t interested in this sort of thing can safely disregard this particular post. The next time someone asks you why web programmers prefer Firefox to Internet Explorer, send them &#8230; <a href="http://www.sixteensmallstones.org/ie-javascript-bugs-overriding-internet-explorers-documentgetelementbyid-to-be-w3c-compliant-exposes-an-additional-bug-in-getattributes">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s time for another technical article.  Those of my readers who aren&#8217;t interested in this sort of thing can safely disregard this particular post.<br />
<br/><br/><br />
The next time someone asks you why web programmers prefer <a href="http://www.getfirefox.com">Firefox</a> to <a href="http://www.microsoft.com/windows/products/winfamily/ie/default.mspx">Internet Explorer</a>, send them a link to this post.  (Even if they don&#8217;t understand it!)<br />
<br/><br/><br />
The increasing popularity of Ajax technologies for web application development has increased the use of JavaScript.  When I first released my first open source project, <a href="http://sourceforge.net/projects/xajax/">xajax</a>, back in May of 2005, the term Ajax was only a few months old.  Programming in JavaScript has since become a major part of my everyday work, and increasingly a growing number of bugs found in our applications are related to inconsistencies in JavaScript implementations in different web browsers.<br />
<br/><br/><br />
Most programmers who work extensively in JavaScript have been stung, often more than once, by Microsoft&#8217;s shoddy, non-standard implementation of manipulating the HTML DOM using JavaScript.  IE7 has been an improvement, but it still has some bugs that make programmers want to rip out their hair.<br />
<br/><br/><br />
One of the cornerstone functions for JavaScript DOM manipulation is the document.getElementById() method which allows the program to get any element in the HTML by its id attribute, which is supposed to uniquely identify that element.<span id="more-145"></span><br />
<br/><br/><br />
There is a well known bug in the Internet Explorer <a href="http://msdn2.microsoft.com/en-us/library/ms536437.aspx">implementation</a> of the getElementById() method, which, contrary to the W3C standard, allows the method to return an element if the element&#8217;s id attribute _or_ its _name_ attribute matches the id the programmer is looking for.  The standard example of why this is problem is as follows:<br />
<br/><br/></p>
<pre>
&lt;html&gt;
	&lt;head&gt;
		&lt;title&gt;Demonstrate IE7 document.getElementById() bug&lt;/title&gt;
		&lt;meta name="description" content="matching on this is a bug"/&gt;
	&lt;/head&gt;
	&lt;body&gt;
		&lt;textarea name="description" id="description"&gt;This is information about the bug&lt;/textarea&gt;
		&lt;script type="text/javascript"&gt;
			alert(document.getElementById('description').value);
		&lt;/script&gt;
	&lt;/body&gt;
&lt;/html&gt;
</pre>
<p><br/><br/><br />
If you view the example in Firefox, you will get a JavaScript alert message containing the content of the textarea.  However, if you view it in IE7 the JavaScript alert will contain the word &#8220;undefined&#8221;.<br />
<br/><br/><br />
The error is caused because IE&#8217;s document.getElementById(&#8216;description&#8217;) sees the meta tag with the name attribute set to &#8220;description&#8221; and since it treats name and id attributes as interchangeable, returns the meta tag instead of the textarea which actually has an id set to &#8220;description&#8221;.  Arrggh!<br />
<br/><br/><br />
JavaScript programmers who are familiar with this bug often take great care to avoid the problem by being circumspect with the names and ids of their elements.  However, this becomes increasingly difficult as applications become more complex with multiple reusable parts that are included into various parts of the same system, especially with multiple programmers working concurrently.  Naming conventions can help, but there are times when the id of an input element (which must be unique) differs from its name attribute, which does not have to be unique.<br />
<br/><br/><br />
In any case, I ran across a slick way of dealing with Internet Explorer&#8217;s badly implemented getElementById() method on a blog called <a href="http://webbugtrack.blogspot.com/2007/08/bug-152-getelementbyid-returns.html">Web Bug Track</a>.  The idea is to override IE&#8217;s native method with one that works according to W3C standards, like this:<br />
<br/><br/></p>
<pre>
&lt;script type="text/javascript"&gt;
if (/msie/i.test (navigator.userAgent)) //only override IE
{
	document.nativeGetElementById = document.getElementById;
	document.getElementById = function(id)
	{
		var elem = document.nativeGetElementById(id);
		if(elem)
		{
			//make sure that it is a valid match on id
			if(elem.id == id)
			{
				return elem;
			}
			else
			{
				//otherwise find the correct element
				for(var i=1;i&lt;document.all[id].length;i++)
				{
					if(document.all[id][i].id == id)
					{
						return document.all[id][i];
					}
				}
			}
		}
		return null;
	};
}
&lt;/script&gt;
</pre>
<p><br/><br/><br />
If we add this JavaScript code to the head of our example, it now works wonderfully, just like Firefox!<br />
<br/><br/><br />
However, I recently implemented this override workaround to the code for our web application, and doing so exposed another bug in IE7 that I hadn&#8217;t run across before.  This bug is in its <a href="http://msdn2.microsoft.com/en-us/library/ms536431.aspx">getAttribute() method</a> .<br />
<br/><br/><br />
The bug happens when you have a form in which there is an input with the name attribute set to &#8220;id&#8221;.  For example,<br />
<br/><br/></p>
<pre>
&lt;html&gt;
	&lt;head&gt;
		&lt;title&gt;Demonstrate IE7 getAttribute() bug&lt;/title&gt;
	&lt;/head&gt;
	&lt;body&gt;
		&lt;form id="myForm1"&gt;
			&lt;input id="user_id" name="user_id" value="text" /&gt;
		&lt;/form&gt;
		&lt;form id="myForm2"&gt;
			&lt;input id="id" name="id" value="text" /&gt;
		&lt;/form&gt;
		&lt;script type="text/javascript"&gt;
			var formElement1 = document.getElementById('myForm1');
			var formElement2 = document.getElementById('myForm2');
			alert(formElement1.getAttribute('id')+ "\n" + formElement2.getAttribute('id'));
		&lt;/script&gt;
	&lt;/body&gt;
&lt;/html&gt;
</pre>
<p><br/><br/><br />
In Firefox, when you load this example you get a JavaScript alert containing the ids of the two forms:<br />
<br/><br/><br />
myForm1<br/><br />
myform2<br />
<br/><br/><br />
But in IE7 you get instead:<br />
<br/><br/><br />
myForm1<br/><br />
[object]<br />
<br/><br/><br />
Somehow, IE7&#8242;s getAttribute() method erroneously accesses the form input with the name &#8220;id&#8221; instead of the actual form element&#8217;s id! A little experimentation shows that you get the same IE7 result even if you use formElement2.id instead of  the getAttribute() method.  Fortunately, you can still get the correct form element id by using one of the following:<br />
<br/><br/><br />
formElement2.attributes['id'].value<br/><br />
formElement2.getAttributeNode(&#8216;id&#8217;).value<br />
<br/><br/><br />
Our overridden getElementById() method depends on comparing the id of the element retrieved by IE7&#8242;s native method with the id that is being sought, but because of this bug in the getAttribute() method and the id property, even when the native method has returned the correct element the comparison fails because the id is the input element instead of the id attribute.<br />
<br/><br/><br />
So, in order to make sure our getElementById() override for IE7 works properly, even when the element we are trying to get is a form containing an input element with the name attribute set to &#8220;id&#8221;, we have to revise our override method as follows:<br />
<br/><br/></p>
<pre>
&lt;script type="text/javascript"&gt;
if (/msie/i.test (navigator.userAgent)) //only override IE
{
	document.nativeGetElementById = document.getElementById;
	document.getElementById = function(id)
	{
		var elem = document.nativeGetElementById(id);
		if(elem)
		{
			//make sure that it is a valid match on id
			if(elem.attributes['id'].value == id)
			{
				return elem;
			}
			else
			{
				//otherwise find the correct element
				for(var i=1;i&lt;document.all[id].length;i++)
				{
					if(document.all[id][i].attributes['id'].value == id)
					{
						return document.all[id][i];
					}
				}
			}
		}
		return null;
	};
}
&lt;/script&gt;
</pre>
<p><br/><br/><br />
So there you go!  Another day in the life of a JavaScript developer!  Hope someone else finds this helpful until Microsoft decides to fix their JavaScript HTML DOM.<br />
<br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sixteensmallstones.org/ie-javascript-bugs-overriding-internet-explorers-documentgetelementbyid-to-be-w3c-compliant-exposes-an-additional-bug-in-getattributes/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>PHP Bug: The magic __call method and overriding methods in child classes</title>
		<link>http://www.sixteensmallstones.org/php-bug-the-magic-call-method-and-overriding-methods-in-child-classes</link>
		<comments>http://www.sixteensmallstones.org/php-bug-the-magic-call-method-and-overriding-methods-in-child-classes#comments</comments>
		<pubDate>Fri, 12 Oct 2007 02:36:00 +0000</pubDate>
		<dc:creator>J. Max Wilson</dc:creator>
				<category><![CDATA[technology]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[This article is about a technical aspect of computer programming and since I know that many of my readers are not computer programmers, and of those that are, many do not program in PHP, you may safely ignore it unless &#8230; <a href="http://www.sixteensmallstones.org/php-bug-the-magic-call-method-and-overriding-methods-in-child-classes">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This article is about a technical aspect of computer programming and since I know that many of my readers are not computer programmers, and of those that are, many do not program in <a href="http://www.php.net">PHP</a>, you may safely ignore it unless it interests you.</p>
<p>As I&#8217;ve been working on a light-weight data access layer for PHP5.1+ that I hope to release as open source in the near future, I have discovered an annoying design flaw in PHP.</p>
<p>Support for a more object-oriented approach to programming has been greatly improved since the introduction of PHP5.  PHP also offers some <a href="http://us2.php.net/manual/en/language.oop5.overloading.php">magic</a> methods that can be used to simulate properties and methods without having to actually declare them individually.  These are great for implementing on the fly methods and properties.</p>
<p>But these magic &#8220;overloading&#8221; methods don&#8217;t function exactly as expected when it comes to inherited child classes.</p>
<p> <span id="more-138"></span></p>
<p>Here an example program to demonstrate the problem I have discovered:</p>
<pre>
&lt;?php
class A
{
// Use the magic __call method to handle
// method calls that aren't actually defined
function __call($strMethod, $arrArgs)
{
switch ($strMethod)
{
case "getEvaluation":
return "PHP " . phpversion();
break;
default:
$strError = 'Call to undefined method ';
$strError .= get_class($this);
$strError .= '::'.$strMethod.'()';
throw new Exception($strError);
break;
}
}
}
class B extends A
{
// Define a real method in the child class
// that overrides the magic method in
// the parent class to modify what it normally
// would return
function getEvaluation()
{
return parent::getEvaluation() . " Rocks!";
}
}
// Instantiate the parent class and call the
// method which should be handled magically by
// the __call method
$A = new A();
echo $A-&gt;getEvaluation() . "&lt;br/&gt;";
// Instantiate the child class and call the method
$B = new B();
echo $B-&gt;getEvaluation() . "&lt;br/&gt;";
?&gt;
</pre>
<p>The output one would expect from this script would be:</p>
<blockquote><p>
PHP 5.2.4<br />
PHP 5.2.4 Rocks!
</p></blockquote>
<p>
But instead this is what you really get:</p>
<p>
<blockquote>
PHP 5.2.4</p>
<p>Fatal error: Call to undefined method A::getevaluation() in /www/test.php on line 34
</p></blockquote>
<p>The magic __call() method is never invoked when an undefined method is called on the parent class from within the child class method.  Ouch!</p>
<p>This was apparently reported as a bug to the PHP development team back  in PHP 5.1 Release Candidate 1 in October of 2005 (<a href="http://bugs.php.net/bug.php?id=34739">Bug #34739</a>) but it was marked as &#8220;Bogus&#8221; and closed with a the explanation that &#8221;__call() is not used when calling static methods.&#8221;</p>
<p>Of course, the explanation is itself &#8220;Bogus.&#8221; It doesn&#8217;t make any sense at all.  In this case, the paamayim-nekudotayim (::) or <a href="http://us2.php.net/manual/en/keyword.paamayim-nekudotayim.php">scope resolution operator</a> is being used in conjunction with the parent keyword to access the overridden method of a parent class within an instance of the child, not a static method on the class.</p>
<p>The code above should work as written.</p>
<p>There is a workaround, but I find it very unsatisfactory.  You have to replace the call to parent::getEvaluation() with parent::<em>_call(&#8216;getEvaluation&#8217;,null) .  This works, but it means that you have to know that your parent class uses the magic </em>_call() method and which methods are magical and which are not in order to override them in a child class.</p>
<p>The child class should be agnostic to whether the parent class methods that it is trying to invoke are real or magical.</p>
<p>So I have <a href="http://bugs.php.net/bug.php?id=42937">submitted the bug</a> to the PHP bug tracker.  Let&#8217;s hope that the developers agree that this is a serious design flaw that interferes with the ability to program object oriented code in PHP.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sixteensmallstones.org/php-bug-the-magic-call-method-and-overriding-methods-in-child-classes/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LDS Tech: Roll Your Own LDS Blog Portal!</title>
		<link>http://www.sixteensmallstones.org/lds-tech-roll-your-own-lds-blog-portal</link>
		<comments>http://www.sixteensmallstones.org/lds-tech-roll-your-own-lds-blog-portal#comments</comments>
		<pubDate>Wed, 25 Jul 2007 20:55:09 +0000</pubDate>
		<dc:creator>J. Max Wilson</dc:creator>
				<category><![CDATA[lds]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[feed aggregator]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Over the last couple of years I have been approached by various individuals looking for a programmer to develop an LDS blog portal. There are, of course, already a couple of popular portals for keeping up with blogging by LDS &#8230; <a href="http://www.sixteensmallstones.org/lds-tech-roll-your-own-lds-blog-portal">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Over the last couple of years I have been approached by various individuals looking for a programmer to develop an LDS blog portal.</p>
<p>There are, of course, already a couple of popular portals for keeping up with blogging by LDS members, but there have sometimes been those who are dissatisfied with the blog selection.  Some feel that too many apostate and borderline apostate blogs are included, while others don&#8217;t feel they are included enough.</p>
<p>Well now anyone can, with a very small amount of effort, create and host his or her own public or private LDS blog portal.</p>
<p>I am not really interested in maintaining my own LDS blog portal to compete with existing portals, even though the code upon which the most popular of these, ldsblogs.org, is <a href="http://www.zeptoworld.com/downloads/">available for free</a> from its creator, Russ Johnston.</p>
<p>However, I do have an interest in new technology, and as a personal challenge, I wondered if I might be able to create a near clone of his portal, using only XHTML, CSS, and JavaScript in conjunction with the nifty new <a href="http://code.google.com/apis/ajaxfeeds/">Google Ajax Feed API</a> .</p>
<p> <span id="more-129"></span></p>
<p>The resulting application is pretty cool, even if I do say so myself.  It reproduces much of the functionality of the Mormon Archipelago portal, without any need for server side code, or complicated feed caching.  And even better, it accomplishes it in about 38K of static XHTML, CSS, and JavaScript that runs entirely in the user&#8217;s browser and communicates to Google to fetch posts from the blogs it aggregates.</p>
<p>And because it requires no server side technology, it can be run from just about anywhere, even from a blogger blogspot.com site or even your own computer&#8217;s hard drive or desktop!</p>
<p>Check out the example running on blogspot at <br />
<a href="http://lds-blogs.blogspot.com">http://lds-blogs.blogspot.com</a></p>
<p>Anyone is free to download the blog portal code and roll their own LDS Blog portal, add or remove feeds, and organize them how ever they wish.</p>
<p>The code can be downloaded in two flavors: a multi file version that splits out the code into 3 separate html, css, and javascript files, or the single file version that includes all of the code in a single html file that can be used as a blogger template.</p>
<p><a href="http://www.sixteensmallstones.org/download/blogportal_multifile.zip">Download Blog Portal Multi File version</a> <br />
<a href="http://www.sixteensmallstones.org/download/blogportal_singlefile.zip">Download Blog Portal Single File version</a></p>
<p>I have maintained the general feel, terminology, and blog groups used by ldsblogs.org because my personal challenge was to create an clone using only client-side technology and I thought it would be good for people to start with something familiar that they could then tweak.  Modify it however you would like to include or exclude blogs, group them differently, or change the labels, how posts are displayed, or even the whole layout if you like.  It is very flexible.</p>
<p>Of course, the code can be used to create not just an LDS blog portal, but any kind of blog portal; to aggregate and group posts from any number of websites that offer RSS Feeds and display them in groups on a single page.</p>
<p><strong>Some technical details</strong></p>
<p>The most difficult part of setting up the blog portal is getting your Google API Key for the website on which you intend to run the portal. You will need to have a Google Account.  If you have a gmail account, you already have one.  If not, you can sign up at <a href="http://www.google.com/accounts/">http://www.google.com/accounts/</a> .</p>
<p>To generate the Google API Key for your website, go to <br />
<a href="http://code.google.com/apis/ajaxfeeds/signup.html">http://code.google.com/apis/ajaxfeeds/signup.html</a> . Login with your Google account if necessary, agree to the Terms of Use and enter the url of your website.  Then click &#8220;Generate API Key&#8221;. Google will generate a key that will look like a long list of letters and numbers.</p>
<p>Open up the index.html file for the portal in a text editor like Notepad and find the following line (about line #17 in the multi file version, line #40 in the single file version):</p>
<p>var FeedAPIKey = &#8216;&#8217;;</p>
<p>Copy and paste the API Key that Google generated in between the single quotes. Like this:</p>
<p>var FeedAPIKey = &#8216;XBQIAAAAyWlSO6jLDRIPbjAOCuNWIBT2XXp_ZAY8_ufC3CFXhHIE1NLwkxSOzqSZjo9n2sRzVuv6OkmWTwCsAR&#8217;;</p>
<p>Then save the index.html file.</p>
<p>At this point, the portal should be fully functional, even if you open it in your browser from your own hard drive or desktop.</p>
<p>The feeds are grouped and displayed using a custom feedGroup JavaScript class that I wrote as a wrapper for the Google Ajax Feed API.  If you want to add, remove, or move a feed from one group to another, simply find the line of JavaScript where it is added to the group in the html file and make the changes.</p>
<p>For instance, if you wanted to add the feed for the official lds.org website to the first group, you would find the lines where the first group is configured and add the following:</p>
<p>feedGroup1.addFeed(&#8216;http://feeds.lds.org/ldsHomeFeatures&#8217;);</p>
<p>That is it.  Now save the html file and reload it in your browser and the most recent posts to lds.org will appear mingled with other posts from sites in the first group.</p>
<p>The download includes as readme file with some additional details, and feel free to ask questions or give feedback here in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sixteensmallstones.org/lds-tech-roll-your-own-lds-blog-portal/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Happy Birthday Xajax!</title>
		<link>http://www.sixteensmallstones.org/happy-birthday-xajax</link>
		<comments>http://www.sixteensmallstones.org/happy-birthday-xajax#comments</comments>
		<pubDate>Thu, 25 May 2006 06:10:00 +0000</pubDate>
		<dc:creator>J. Max Wilson</dc:creator>
				<category><![CDATA[technology]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[xajax]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Today is the one year anniversary of my open source project: xajax! The xajax project was registered with SourceForge.net on May 24th 2005, just slightly more than 3 months after the very term Ajax was coined by Jesse James Garrett &#8230; <a href="http://www.sixteensmallstones.org/happy-birthday-xajax">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Today is the one year anniversary of my open source project: xajax!</p>
<p>The xajax project was registered with <a href="http://sourceforge.net/projects/xajax">SourceForge.net</a> on May 24th 2005, just slightly more than 3 months after the very term <a href="http://en.wikipedia.org/wiki/Ajax_%28programming%29">Ajax</a> was coined by Jesse James Garrett in his <a href="http://www.adaptivepath.com/publications/essays/archives/000385.php">article</a> published on February 18, 2005 at Adaptive Path.</p>
<p>We&#8217;ve come a long way since then, thanks to the great efforts and skill of <a href="http://www.theideabasket.com/">Jared White</a> and Eion Robb. </p>
<p>We have 782 registered users in the xajax community <a href="http://community.xajaxproject.org/">forum</a>, and 6200 posts in 1263 Topics since the forum was established in October 2005.</p>
<p>Xajax has been downloaded <a href="http://sourceforge.net/project/stats/?group_id=139736&#38;ugn=xajax">48,318</a> times from SourceForge.net. The <a href="http://www.xajaxproject.org/">xajaxproject.org</a> homepage gets an average of <a href="http://www.sitemeter.com/?a=stats&#38;s=s21xajax">900</a> visits per day.</p>
<p>Thanks to all of you have donated to the project and a big thanks to all of you who are using xajax and contributing feature requests, finding bugs, and helping others in the community!</p>
<p>We look forward to another great year as xajax continues to develop to meet your development needs.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sixteensmallstones.org/happy-birthday-xajax/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Firebug Extension for Firefox</title>
		<link>http://www.sixteensmallstones.org/the-firebug-extension-for-firefox</link>
		<comments>http://www.sixteensmallstones.org/the-firebug-extension-for-firefox#comments</comments>
		<pubDate>Wed, 18 Jan 2006 23:31:47 +0000</pubDate>
		<dc:creator>J. Max Wilson</dc:creator>
				<category><![CDATA[technology]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[If you develop for the web, there is a new extension for Firefox that you simply must get: Firebug combines the functionality of the DOM inspector with the Error console and command-line JavaScript interpretor and then packs it with some &#8230; <a href="http://www.sixteensmallstones.org/the-firebug-extension-for-firefox">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you develop for the web, there is a new extension for Firefox that you simply must get:</p>
<p><a href="http://www.joehewitt.com/software/firebug/">Firebug</a> combines the functionality of the DOM inspector with the Error console and command-line JavaScript interpretor and then packs it with some great additional features.</p>
<p> <span id="more-23"></span></p>
<p>Among its many features, Firebug allows you to inspect XMLHttpRequest responses, and so it will be invauable when debugging Ajax applications.</p>
<p>Another great feature is the ability to log custom debug messages from your javascript.  Until now, debugging JavaScript often involved strategically placed alert messages.  With Firebug, you simply add the following code to your script:</p>
<pre>
function printfire()
{
    if (document.createEvent)
    {
        printfire.args = arguments;
        var ev = document.createEvent("Events");
        ev.initEvent("printfire", false, true);
        dispatchEvent(ev);
    }
}
</pre>
<p>Then you call printfire(something); in your script and your debug message will be logged in the Firebug console.</p>
<p>You can read about Firebug&#8217;s other features in the <a href="http://www.joehewitt.com/software/firebug/faq.php">FAQ</a> .</p>
<p>Congratulations to programmer Joe Hewitt for this great plugin!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sixteensmallstones.org/the-firebug-extension-for-firefox/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>xajax 0.2 released</title>
		<link>http://www.sixteensmallstones.org/xajax-02-released</link>
		<comments>http://www.sixteensmallstones.org/xajax-02-released#comments</comments>
		<pubDate>Fri, 30 Dec 2005 07:01:00 +0000</pubDate>
		<dc:creator>J. Max Wilson</dc:creator>
				<category><![CDATA[technology]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[xajax]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I&#8217;m pleased to announce the release of xajax version 0.2. The xajax PHP library allows PHP developers to easily add Ajax functionality to their PHP driven websites. A big thank you to Jared White for his excellent work on the &#8230; <a href="http://www.sixteensmallstones.org/xajax-02-released">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m pleased to announce the release of <a href="http://www.xajaxproject.org">xajax version 0.2</a>.</p>
<p>The xajax PHP library allows PHP developers to easily add <a href="http://en.wikipedia.org/wiki/Ajax_%28programming%29">Ajax</a> functionality to their PHP driven websites.  A big thank you to Jared White for his excellent work on the project and to our wonderful forum participants who have helped debug, submitted code improvements, and suggested feature enhancements.</p>
<p>Also a special thanks to those who donated money to the project.  The donations will help us pay for hosting for the new xajax <a href="http://www.xajaxproject.org">webite</a>, <a href="http://wiki.xajaxproject.org">wiki</a>, and <a href="http://community.xajaxproject.org">forum</a> .</p>
<p> <span id="more-20"></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sixteensmallstones.org/xajax-02-released/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ajax &amp; XUL with xajax</title>
		<link>http://www.sixteensmallstones.org/ajax-xul-with-xajax</link>
		<comments>http://www.sixteensmallstones.org/ajax-xul-with-xajax#comments</comments>
		<pubDate>Fri, 02 Dec 2005 20:25:00 +0000</pubDate>
		<dc:creator>J. Max Wilson</dc:creator>
				<category><![CDATA[technology]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[xajax]]></category>
		<category><![CDATA[xul]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[One interesting subject that has come up in the the xajax project forum is using our xajax library to implement PHP driven Ajax for XUL applications written to run in Mozilla based browsers like Firefox. In case you don&#8217;t know &#8230; <a href="http://www.sixteensmallstones.org/ajax-xul-with-xajax">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>One interesting subject that has come up in the the xajax project <a href="http://www.intuitivefuture.com/xajaxforums/viewtopic.php?id=153">forum</a> is using our <a href="http://xajax.sf.net">xajax</a> library to implement PHP driven Ajax for <a href="http://www.mozilla.org/projects/xul/">XUL</a> applications written to run in Mozilla based browsers like Firefox.  In case you don&#8217;t know about it already, XUL is Mozilla&#8217;s XML-based User interface Language.  Developers use XUL to create extensions for Firefox, among other things.</p>
<p> <span id="more-6"></span></p>
<p>Using xajax with xul is only in the beginning stages of exploration, but I look forward to what comes out of it.  While it does not work with today&#8217;s xajax beta test, I&#8217;ve made a slight modification to the development version of xajax in CVS that makes it so that it will work with XUL, and I&#8217;ve added a couple of very simple examples to the repository as well.  These changes will be included in the official release of xajax 0.2 after the beta test in complete.</p>
<p>Here is an example for the curious.  We have two files, a .php server file that processes requests from the xul application, and a .xul application xml file.</p>
<p><strong>xulServer.php</strong>:</p>
<pre>&lt;?php
// xulServer.php demonstrates a XUL application with xajax
// XUL will only work in Mozilla based browsers like Firefox
// using xajax version 0.2
// http://xajaxproject.org
require_once("xajax.inc.php");
function test()
{
        $objResponse = new xajaxResponse();
        $objResponse-&gt;addAlert("Hello World!");
        $objResponse-&gt;addAssign('testButton','label','Success!');
        return $objResponse-&gt;getXML();
}
$xajax = new xajax();
$xajax-&gt;registerFunction("test");
$xajax-&gt;processRequests();
?&gt;</pre>
<p>If you want to create a standalone XUL app that is not generated by PHP you  have to hardcode the javascript variables and links in your xul code instead of using the printJavascript() function and you have to use the xajax.call() function to call your xajax functions instead of the &#8220;xajax_&#8221; functions that are normally generated by the PHP xajax library. </p>
<p><strong>xulClient.xul</strong>:</p>
<pre>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"&gt;
&lt;head&gt;
        &lt;link rel="stylesheet" type="text/css"
         href="/css/default.css"/&gt;
        &lt;script type="application/x-javascript"&gt;
                var xajaxRequestUri="xulServer.php";
                var xajaxDebug=false;
                var xajaxStatusMessages=false;
                var xajaxDefinedGet=0;
                var xajaxDefinedPost=1;
        &lt;/script&gt;
        &lt;script type="application/x-javascript"
        src="http://www.sixteensmallstones.org/xajax_js/xajax.js"&gt;
        &lt;/script&gt;
&lt;/head&gt;
&lt;xul:button id="testButton" oncommand="xajax.call('test',[]);"
 label="Test"/&gt;
&lt;/html&gt;</pre>
<p>I&#8217;ll be interested in seeing where our xajax users will go with this.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sixteensmallstones.org/ajax-xul-with-xajax/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

