<?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>Pixelbox &#187; Hijax</title>
	<atom:link href="http://www.pixelbox.net/category/development/hijax/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pixelbox.net</link>
	<description>Pixelbox, technology development and photography.</description>
	<lastBuildDate>Thu, 08 Apr 2010 16:35:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Interview questions to ask a front end developer</title>
		<link>http://www.pixelbox.net/2008/01/09/interview-questions-to-ask-a-front-end-developer/</link>
		<comments>http://www.pixelbox.net/2008/01/09/interview-questions-to-ask-a-front-end-developer/#comments</comments>
		<pubDate>Wed, 09 Jan 2008 12:28:51 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Hijax]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.pixelbox.net/2008/01/09/interview-questions-to-ask-a-front-end-developer/</guid>
		<description><![CDATA[This-morning I had to quickly run up some questions for someone&#8217;s second interview. We were looking for someone with good front end knowledge, so I knocked up some questions to ask them. I found these were very good at getting them talking, and gave them a lot of potential to show they had a strong [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://www.pixelbox.net/wp-content/uploads/2008/01/814457_business_card_3.thumbnail.jpg' alt='Interview' />
<p>
This-morning I had to quickly run up some questions for someone&#8217;s second interview. We were looking for someone with good front end knowledge, so I knocked up some questions to ask them. I found these were very good at getting them talking, and gave them a lot of potential to show they had a strong knowledge in the field.
</p>
<p>Let me know if you think there are some other good questions that will provoke some good discussions!</p>
<h3>HTML Questions</h3>
<ul>
<li>What is a doctype?</li>
<li>What different versions of HTML are there, what&#8217;s the difference between transitional and strict?</li>
<li>What do you know about HTML 5, and do you think you will use it?</li>
<li>What are the advantages and disadvantages of using web standards.</li>
<li>Do you know what the trinity of web standards are? (Separation of, structure, behavior and presentation)</li>
<li>What is the concept behind the semantic web, and why does it matter?</li>
<li>Do you know what micro formats are?</li>
<li>What related blogs or websites to you read?</li>
</ul>
<h3>Accessibility Questions</h3>
<ul>
<li>What is accessibility and why does it matter?</li>
<li>What should you put in alt text for presentational images?</li>
<li>Why are, &#8220;click here&#8221; links bad to use?</li>
<li>Why do people use skip to content and skip to navigation links?</li>
<li>How can CSS aid accessibility?</li>
<li>How can you test for accessibility compliancy? Why do automated tests not guaranty accessibility.</li>
<li>What related blogs or websites to you read?</li>
</ul>
<h3>CSS Questions</h3>
<ul>
<li>What is the difference between using inline CSS and using an external CSS file. When would you use inline CSS?</li>
<li>What browser do you develop in?</li>
<li>What browsers do you test in?</li>
<li>What is the ACID2 test?</li>
<li>Who or what is WASP?</li>
<li>What are CSS hacks and what are they used for?</li>
<li>What related blogs or websites to you read?</li>
</ul>
<h3>SEO Questions</h3>
<ul>
<li>What would you said the main 4 search engines are?</li>
<li>What would you say the most important element in the head of an HTML document are?</li>
<li>What would you say the most important element in the body of an HTML document are?</li>
<li>How do search engines treat content inside an IFrame?</li>
<li>How can you convey information in an image to a search engine.</li>
<li>How can you convey information in a flash movie to a search engine.</li>
<li>What is keyword stuffing?</li>
<li>What is cloning?</li>
<li>How should you re-direct traffic from http://pixelbox.net to http://www.pixelbox.net ?</li>
<li>What related blogs or websites to you read?</li>
</ul>
<h3>JavaScript Questions</h3>
<ul>
<li>What is ECMAScript?</li>
<li>What is the DOM?</li>
<li>What is unobtrusive JavaScript? Why is it important? What is HIJAX</li>
<li>How would you add a JavaScript event to a link or button, and why?</li>
<li>What are the advantages and disadvantages of Frameworks?</li>
<li>What would you do if a framework could not provide the functionality you needed?</li>
<li>What frameworks have you used and why did you choose it?</li>
<li>What is browser sniffing and where would you use it? (trick question&#8230; never!)</li>
<li>What is Comet? What sites use it?</li>
<li>What is JSON? Why would you use JSON over XML?</li>
<li>What sites do you think use JavaScript well?</li>
<li>What industry blogs do you read?</li>
<li>How do you debug JavaScript</li>
<li>What problems have you had with IE when DOM scripting and how have you overcome them?</li>
<li>What related blogs or websites to you read?</li>
</ul>
<h3>Tools Questions</h3>
<ul>
<li>What software do you use to develop in and why?</li>
<li>What are the advantages and disadvantages of using WYSIWYG development tools?</li>
<li>What browser do you use to develop in and why?</li>
<li>What browser do you use on a daily basis, and why?</li>
<li>What is any, plugins or bookmarklets do you use?</li>
<li>What browsers do you test you work in?</li>
<li>What operating systems do you test your work in?</li>
<li>Do you use source control, if so what, if not why not?</li>
<li>Do you develop locally or on a remote server?</li>
<li>Do you know how to set up a web server, apache, MySQL etc</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelbox.net/2008/01/09/interview-questions-to-ask-a-front-end-developer/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Generic Error messages</title>
		<link>http://www.pixelbox.net/2007/12/18/generic-error-messages/</link>
		<comments>http://www.pixelbox.net/2007/12/18/generic-error-messages/#comments</comments>
		<pubDate>Tue, 18 Dec 2007 10:09:56 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Hijax]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.pixelbox.net/2007/12/18/generic-error-messages/</guid>
		<description><![CDATA[Recently I needed an method for displaying error messages that was nicer than alert boxes, unobtrusive and generic. I wanted to be able to output errors from PHP in the HTML that could then be displayed in an eye catching way, but also use the same method to display errors from JavaScript. This way you [...]]]></description>
			<content:encoded><![CDATA[<p>
Recently I needed an method for displaying error messages that was nicer than alert boxes, unobtrusive and generic.
</p>
<p>
I wanted to be able to output errors from PHP in the HTML that could then be displayed in an eye catching way, but also use the same method to display errors from JavaScript. This way you have one method for displaying errors to your users, rather than a mix of inline, alerts and error pages.
</p>
<p>
The solution will run once the DOM is ready and search for elements with the class, &#8220;ssError&#8221; (server side error). If it finds them it will remove them from where they are and add them to a generic error div at the top of the page, which will then be animated so the user notices it.
</p>
<p>
This code requires various parts of the YUI library, which must be included before the error.js file. To display server side errors, just add the class ssError to them, and to output client side error just call the function PBdisplayErrors(&#8216;Your Error here!&#8217;) with you error as a string.
</p>
<p><a href="#" onclick="PBdisplayErrors('Yikes! This is an error!')">Click here to simulate an error!</a></p>
<p>There is <a href="http://www.pixelbox.net/demos/errorExample/">an example of the error message and a link to the js file here</a>.</p>
<p>
This is the first time I have used the YUI libraries, they are a little confusing at first, but show great examples of best practice. Previously I used prototype, which gives you more finished animations, whilst the YUI is a little more raw. I do really like the event model though, which is really useful for hijax and dealing with XML header requests.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelbox.net/2007/12/18/generic-error-messages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My recent links&#8230;</title>
		<link>http://www.pixelbox.net/2006/12/20/my-recent-links/</link>
		<comments>http://www.pixelbox.net/2006/12/20/my-recent-links/#comments</comments>
		<pubDate>Wed, 20 Dec 2006 09:35:19 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Hijax]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.pixelbox.net/2006/12/20/my-recent-links/</guid>
		<description><![CDATA[Last night I spent about half an hour I should have spend a long time ago, installing a plug in to display my recent links from del.icio.us (social bookmarking). It was fairly easy, I downloaded a script for displaying RSS feeds, changed the link and called if from inside an un-ordered list on my side [...]]]></description>
			<content:encoded><![CDATA[<p><a title="delicious logo" href="http://flickr.com/photos/77646648@N00/327987090"><img border="0" src="http://static.flickr.com/144/327987090_405173353f_m.jpg" /></a></p>
<p>Last night I spent about half an hour I should have spend a long time ago, installing a plug in to display my recent links from del.icio.us (social bookmarking).</p>
<p>It was fairly easy, I downloaded a script for displaying RSS feeds, changed the link and called if from inside an un-ordered list on my side bar. Job done.</p>
<p>However I have to say I am slightly un-impressed with it. Currently it seems to only update every now and again, obviously you wouldn&#8217;t want to delay my site loading whilst it fetched an RSS feed from another server. Especially not every time you refresh the page.</p>
<p>It seems that instead it downloads the XML to a temp folder and uses that. However its really annoying when I want to see up to the minute info on my links.</p>
<p>So I gathered that the solution to this problem is to overlay what I currently have with a client side script which gets the feed from the site directly after the initial page has loaded.</p>
<p>In effect this allows up to date information, and also has the cashed information to fall back on (Hijax-styli)&#8230; however I am yet to implement it ;)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelbox.net/2006/12/20/my-recent-links/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Extreme Programming</title>
		<link>http://www.pixelbox.net/2006/12/13/extreme-programming/</link>
		<comments>http://www.pixelbox.net/2006/12/13/extreme-programming/#comments</comments>
		<pubDate>Wed, 13 Dec 2006 00:03:48 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Hijax]]></category>

		<guid isPermaLink="false">http://www.pixelbox.net/2006/12/13/extreme-programming/</guid>
		<description><![CDATA[I was in a meeting today with Aral Balkan looking into future development of one of our products, and was introduced to my first industrial experience of Extreme Programming. Personally I come from an SSADM background at university and XP is more or less the complete other end of the spectrum. I feel SSADM is [...]]]></description>
			<content:encoded><![CDATA[<p>
I was in a meeting today with <a href="http://www.aralbalkan.com/" title="Aral Balkan">Aral Balkan</a> looking into future development of one of our products, and was introduced to my first industrial experience of <a href="http://en.wikipedia.org/wiki/Extreme_programming" >Extreme Programming</a>.
</p>
<p>
Personally I come from an <a href="http://en.wikipedia.org/wiki/SSADM" title="Structured Systems Analysis and Design Method">SSADM</a> background at university and <acronym title="Extreme Programming">XP</acronym> is more or less the complete other end of the spectrum.
</p>
<p>
I feel <acronym title="Structured Systems Analysis and Design Method">SSADM</acronym> is a fantastic basis for a developer and many products such as Logical Data Modelling and its conversion to <acronym title="Entity-relationship diagram">ERD</acronym>s have provided invaluable in almost any project I have been involved in. However a lot of the time <acronym title="Structured Systems Analysis and Design Method">SSADM</acronym> is an over kill, and smaller projects or updates of new functionality just don&#8217;t fit in. (for example I researched XP for my solo final year project where I was working closely with my client)
</p>
<p>
With <acronym title="Extreme Programming">XP</acronym> you have a method that is more or less exactly how I have found myself developing in recent times. Our environment at work is, I&#8217;m sure, nothing like the UK government office that conceived <acronym title="Structured Systems Analysis and Design Method">SSADM</acronym> and therefore not best suited. However I also feel that some aspects of the complexity of our projects also fall outside the scope of <acronym title="Extreme Programming">XP</acronym>, for example, where the sentence, &#8220;Design and code for today and not for tomorrow.&#8221;, would send shivers down my spine.
</p>
<p>
I think that starting off development with a good analysis and understanding is vital but I also feel user feedback and prototyping is very important in delivering exactly what the client wants.
</p>
<p>
Unfortunately this isn&#8217;t always the goal of a development team as some products are sold upfront, where changes throughout the development will undoubtedly increase the time and cost. Instead some developers find themselves grinding out the minimum requirements of a spec to increase revenue forcing the client to pay extra for features they believed to be standard.
</p>
<p>
I would love to work in an environment where projects were developed in simple increments. So rather than developing a full blown dynamically driven web-site with hundreds of bells and whistles, from scratch for a pre arranged fee, we could instead develop a web site, then a CMS to sit under it, then a bell here, a whistle there (perfect for Hijax). However this isn&#8217;t always possible, and sometimes you find yourself learning the hard way. Which is why I think having experience in different methodologies, and knowing when to use them, or even aspects of them is vital when working in our industry.
</p>
<p>
Well that or its midnight and I&#8217;m babbling crap again&#8230; ;)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelbox.net/2006/12/13/extreme-programming/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>IEs support for the DOM sucks</title>
		<link>http://www.pixelbox.net/2006/11/14/ies-support-for-the-dom-sucks/</link>
		<comments>http://www.pixelbox.net/2006/11/14/ies-support-for-the-dom-sucks/#comments</comments>
		<pubDate>Tue, 14 Nov 2006 17:23:10 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Hijax]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.pixelbox.net/2006/11/14/ies-support-for-the-dom-sucks/</guid>
		<description><![CDATA[Again I find myself running into problems with IE, today its with it&#8217;s DOM support. I recently wrote some JavaScript to look at a links href attribute to detect if the link was external or not (the existence of HTTP:// would show it was external). The problem was that Internet Explorer showed the absolute href [...]]]></description>
			<content:encoded><![CDATA[<p>
Again I find myself running into problems with IE, today its with it&#8217;s DOM support.
</p>
<p>
I recently wrote some JavaScript to look at a links href attribute to detect if the link was external or not (the existence of HTTP:// would show it was external). The problem was that Internet Explorer showed the absolute href rather than the text content of the attribute in the DOM. Therefore it meant that every link had HTTP:// in it&#8217;s href attribute.
</p>
<p>
I discovered that you could pass a section option in the JavaScript for .getAttribute that would force IE to return the value of the href in the DOM rather than how it saw it. This was found via <a href="http://www.glennjones.net/Post/809/getAttributehrefbug.htm">Glenn Jone&#8217;s</a> post on Internet Explorers getAttribute href bug.
</p>
<p>
Another day another IE work around&#8230; sigh</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelbox.net/2006/11/14/ies-support-for-the-dom-sucks/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Problems with setAttribute in IE</title>
		<link>http://www.pixelbox.net/2006/11/13/problems-with-setattribute-in-ie/</link>
		<comments>http://www.pixelbox.net/2006/11/13/problems-with-setattribute-in-ie/#comments</comments>
		<pubDate>Mon, 13 Nov 2006 11:43:55 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Hijax]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.pixelbox.net/2006/11/13/problems-with-setattribute-in-ie/</guid>
		<description><![CDATA[Whilst being Pr0 and trying to work around IE&#8217;s inability to understand the CSS :after class I used JavaScript to add a clearing element after the classes through the DOM, but only for IE. (I know browser sniffing is wrong but if it adds in a clearing element in Opera too there won&#8217;t be any [...]]]></description>
			<content:encoded><![CDATA[<p>
Whilst being Pr0 and trying to work around IE&#8217;s inability to understand the CSS :after class I used JavaScript to add a clearing element after the classes through the DOM, but only for IE. (I know browser sniffing is wrong but if it adds in a clearing element in Opera too there won&#8217;t be any ill effect).
</p>
<p>
Anyway I found that Internet Explorer can&#8217;t add style content through setAttribute and also can&#8217;t seem to set the class name and then apply the class from the CSS.
</p>
<p>
After a bit of digging on the web I found that you can use setAttribute(&#8220;className&#8221;,&#8221;clearAll&#8221;); to do the same in IE. This works fine but be sure to remember that if Opera or Camino are pretending to be IE they wont add the class name through className so it&#8217;s worth adding a class in too, just as a back up. (Why can&#8217;t browsers pretending to be IE not have another navigator element saying their true identity)
</p>
<p>
Thanks to <a href="http://www.quirksmode.org/bugreports/archives/2005/03/setAttribute_does_not_work_in_IE_when_used_with_th.html">quirksmode</a>
</p>
<p> for the info on this!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelbox.net/2006/11/13/problems-with-setattribute-in-ie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Truncating HTML elements through the DOM</title>
		<link>http://www.pixelbox.net/2006/11/08/truncating-html-elements-through-the-dom/</link>
		<comments>http://www.pixelbox.net/2006/11/08/truncating-html-elements-through-the-dom/#comments</comments>
		<pubDate>Wed, 08 Nov 2006 15:55:56 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Hijax]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.pixelbox.net/2006/11/08/truncating-html-elements-through-the-dom/</guid>
		<description><![CDATA[After the launch of Monkey I have had time to (been forced to) do some other projects. Whilst being a nice change it&#8217;s also rather annoying not getting to polish something once you have got the first release out. However needs must and hopefully I will be back on it soon. Being back on the [...]]]></description>
			<content:encoded><![CDATA[<p>
After the launch of Monkey I have had time to (been forced to) do some other projects. Whilst being a nice change it&#8217;s also rather annoying not getting to polish something once you have got the first release out. However needs must and hopefully I will be back on it soon.
</p>
<p>
Being back on the front end train I have strived to gets some things perfect and armed with my new love for the DOM and Hijax I have started to seen new potential solutions to problems.
</p>
<p>
The one I had today was a design issue where by an ordered list on a website had the potential to contain an item that would wrap onto more than one line. Consequently breaking the nice look and feel of a page.
</p>
<p>
I found my self with potentially three options to solve this problem.
</p>
<ol>
<li>Do it back end in the CMS</li>
<li>Use CSS to limit it&#8217;s width</li>
<li>Use DOM Scripting to truncate the node content</li>
</ol>
<p>
Doing it in the back was a bad idea. Firstly its more work in the back end which is already overflowing with work and secondly we would loose content for something which is related to a front end style.
</p>
<p>
Therefore I decided to go front end on it and had to choose between CSS and JavaScript to perform the truncation of my text.
</p>
<p>
CSS has the advantage of speed over JavaScript, mainly because you need to wait for the DOM to load before you can edit it meaning that you could potentially see the content disappear before your very eyes.
</p>
<p>
With CSS we can set the list item in the ordered list to have a set width and no visible overflow. This works well but has no evidence that something has been truncated, and may lead to bad results. Also when you supply overflow: hidden; to a list item in an ordered list the item number is hidden&#8230; great! However my list items needed to be links, giving me an anchor tag to apply the overflow:hidden to.
</p>
<p>
The next problem was to add the &#8230; onto the end of the truncated item. This can be done with the CSS pseudo-element :after which can add in content. However there is no way to apply logic to say only apply the content if it has an overflow.
</p>
<p>
So the next way to do it was with JavaScript and the DOM, the advantage here was you could apply the changed with logic. You can vary the max size on elements through HTML attributes, apply truncation only when needed, move the full version into another element and if it doesn&#8217;t work you can still use the CSS to back you up.
</p>
<p><code></p>
<p>function maxLen() {<br />
    var toTruncate = new Array();<br />
    var toTruncate = getElementsByClassName( document, "*", "truncate" );<br />
    var length;<br />
    var truncated;<br />
    var content;<br />
    for( var i=0; i < toTruncate.length; i++ ){<br />
        length = toTruncate[i].getAttribute('title');<br />
        toTruncate[i].setAttribute('title','');<br />
        if(toTruncate[i].firstChild.nodeType == 3){<br />
            content = toTruncate[i].firstChild.nodeValue;<br />
            if( content.length > length ){<br />
                truncated = content.substr(0,length);<br />
                toTruncate[i].firstChild.nodeValue = truncated+"...";<br />
                toTruncate[i].setAttribute('title',content);<br />
            }<br />
        }</p>
<p>    }<br />
}</p>
<p></code></p>
<p>
Here I used a construct function to call my script on page load, and also used a method to get elements by class name, there are lots on the web you can use!
</p>
<p>
Let me know what you think or if you have any other options!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelbox.net/2006/11/08/truncating-html-elements-through-the-dom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An Ajax.Periodical Updater that you can turn off!</title>
		<link>http://www.pixelbox.net/2006/09/28/52/</link>
		<comments>http://www.pixelbox.net/2006/09/28/52/#comments</comments>
		<pubDate>Thu, 28 Sep 2006 14:22:30 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Hijax]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.pixelbox.net/2006/09/28/52/</guid>
		<description><![CDATA[At work recently I came across an instance where I wanted to turn a script.aculo.us Ajax.Periodical Updater on and off. After looking on the wiki it appeared that there was no way to turn the thing off once you had started it other than reloading the page. You could for example want to turn it [...]]]></description>
			<content:encoded><![CDATA[<p>
At work recently I came across an instance where I wanted to turn a script.aculo.us Ajax.Periodical Updater on and off.
</p>
<p>
After looking on the wiki it appeared that there was no way to turn the thing off once you had started it other than reloading the page. You could for example want to turn it off after an hour or when a user clicks a button.
</p>
<p>
So I came up with this code which uses a normal updater which on complete waits for a set amount of time before calling another function. This function checks a global variable to see if the updater is on or off and depending on the outcome either updates again or does nothing (stops it).
</p>
<p>
The code is below and also includes some Hijax to convert a normal link into our toggle button.
</p>
<pre>
<code>
var global_updater_status = 'on';

function apply_toggle_updater() {
	// In your HTML you need a button or anchor like; <a href="nonAjaxCode.php" title="Turn updater off" id="toggle_updater">Toggle Updater</a> with the id relating to below
	// You also need to run this function onload
	if( document.getElementById('toggle_updater') ){
		var theButton = document.getElementById('toggle_updater');
		theButton.onclick = 	function(){
										toggle_updater(); return false;
									};
	}
}

function toggle_updater(){
	if(global_updater_status == 'on'){
		global_updater_status = 'off';
	}else{
		global_updater_status = 'on';
		Updater();
	}
}

function Updater() {
	var url = 'ajaxGetStatus.php';
	var pars = "id=8";
	var target = "status";
	var myAjax = new Ajax.Updater(target, url, {method: 'get', parameters: pars, asynchronous:true, evalScripts:true, onComplete:function() { setTimeout('Periodical()',2000); } });
	// This one updates every 2 seconds as long as the global variable is set to on
}

function Periodical(){
	if(global_updater_status == 'on'){
		Updater();
	}
}
</code>
</pre>
<p>
Hope this helps!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelbox.net/2006/09/28/52/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
