<?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; Ajax</title>
	<atom:link href="http://www.pixelbox.net/category/development/ajax/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>Gmail server errors&#8230; ooops!</title>
		<link>http://www.pixelbox.net/2007/03/02/102/</link>
		<comments>http://www.pixelbox.net/2007/03/02/102/#comments</comments>
		<pubDate>Fri, 02 Mar 2007 10:53:20 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.pixelbox.net/2007/03/02/102/</guid>
		<description><![CDATA[Yesterday I had a problem with Gmail where I couldn&#8217;t get to my in box. I though this would pass but it didn&#8217;t and other people in the office were getting on fine. I started by clearing my cache and flushing my DNS but it still didn&#8217;t work on Safari, Firefox, Flock or Omniweb, even [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://farm1.static.flickr.com/164/406647565_1a4c033750_m.jpg" title="Google mail error" alt="Google mail error" height="120" width="240" /></p>
<p>Yesterday I had a problem with Gmail where I couldn&#8217;t get to my in box. I though this would pass but it didn&#8217;t and other people in the office were getting on fine.</p>
<p>I started by clearing my cache and flushing my DNS but it still didn&#8217;t work on Safari, Firefox, Flock or Omniweb, even adium and Google notifier didn&#8217;t work&#8230;</p>
<p>When I got home I still had the same problem, even after re booting and clearing stuff out again.</p>
<p>This morning I tried google&#8217;s help page and it told me I should log out, then clear my cache and then try again. Which I am happy to say worked!</p>
<p>The question is, what caused this??? and why would it effect all my applications?</p>
<p><a href="http://www.flickr.com/photos/oxton/406647565/" title="Gmail problems"> I see others are having the same gmail problems </a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelbox.net/2007/03/02/102/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fun with google maps</title>
		<link>http://www.pixelbox.net/2007/02/24/fun-with-google-maps/</link>
		<comments>http://www.pixelbox.net/2007/02/24/fun-with-google-maps/#comments</comments>
		<pubDate>Sat, 24 Feb 2007 12:41:14 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.pixelbox.net/2007/02/24/fun-with-google-maps/</guid>
		<description><![CDATA[Over the last few days at work I had some time to get creative with Google maps. I was asked to implement google maps in a pop up window, which having never done before I expected would take a fair amount of time. However implementing what we had seen on another site was more or [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Google maps API" href="http://www.bigkidlondon.com/yap-yap/index.php?page_id=5"><img border="0" src="http://static.flickr.com/180/400638024_28a7621ca6_m.jpg" /></a>Over the last few days at work I had some time to get creative with Google maps. I was asked to implement google maps in a pop up window, which having never done before I expected would take a fair amount of time. However implementing what we had seen on another site was more or less done with you by Google.</p>
<p>So this gave me opportunity to play around with the API and add some fun logic on top of that, with <a href="http://www.bigkidlondon.com/yap-yap/index.php?page_id=5">BigKid</a> being a creative agency this seemed to fit really well, and added one of those little easter eggs you see and think wow that&#8217;s really cool and they don&#8217;t even promote it. Hopefully we can add more when the opportunity is there :)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelbox.net/2007/02/24/fun-with-google-maps/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Efficient AJAX forms with prototype</title>
		<link>http://www.pixelbox.net/2006/10/06/efficient-ajax-forms-with-prototype/</link>
		<comments>http://www.pixelbox.net/2006/10/06/efficient-ajax-forms-with-prototype/#comments</comments>
		<pubDate>Fri, 06 Oct 2006 10:20:05 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.pixelbox.net/2006/10/06/efficient-ajax-forms-with-prototype/</guid>
		<description><![CDATA[In the past I have found posting forms via Ajax to be a pain in the ass. Mainly because you have to go through the DOM and get the values for each field and then pass them through to your AJAX target page as post or get variables. Just recently I came up with a [...]]]></description>
			<content:encoded><![CDATA[<p>
In the past I have found posting forms via Ajax to be a pain in the ass. Mainly because you have to go through the DOM and get the values for each field and then pass them through to your AJAX target page as post or get variables.
</p>
<p>
Just recently I came up with a problem where by I needed to only perform an update if values have changed, as the action taken was quite complex and took a bit of time. Firstly I updated my PHP page to only perform the action if the class&#8217;s values had changed. This was great but my front end had no idea of the PHP script&#8217;s findings and consiquently didn&#8217;t know how to react. Should it start looking as though it was doing to time comsuming update, or should it just do nothing?
</p>
<p>
With no way of knowing, my front end would start an animation as though it was waiting for the timely update but as it wasn&#8217;t taking any time at all it would try and perform the finished animation too soon, resulting it a horrid looking car crash of an animation. I solved this by moving all new animations to the back of a queue (<a href="http://blog.railsdevelopment.com/pages/effect/queue/" title="Railsdevelopment")more on animation and effect queues</a>) but it still didn&#8217;t actually need any animations at all.<br />
</a></p>
<p>
I then decided that in order to get my JavaScript in line with my PHP, I would need to do a client side check to detect changes to my form. In steps&#8230; <b><a href="http://wiki.script.aculo.us/scriptaculous/show/Form.serialize">Form.serialize()</a></b>, using this function to quickly get the values of a form I could detect change just like with my PHP classes by performing a classic <i>before and after</i> comparison.
</p>
<p>
So when I first get my form using AJAX I quickly update a global variable with the results from Form.serialize($(&#8216;the_id_of_your_form&#8217;). Then later when I am about to use AJAX to send my PHP script the new form values I perform the same function again into a new variable.
</p>
<p>
Now I have two variables with the contents of the form, both before and after allowing me to compare them and perform the AJAX call only if needed (as well as the subsquent animation effects).
</p>
<pre><code>
// In the AJAX get form, on complete function do this: global_form_data = Form.serialize($('options_form')); (don't forget to set up the global variable outside your function first)

	function save_form_values() {
			var pars = Form.serialize($('form'));
			if ( global_form_data != pars ){
			    // Enter AJAX call here with new values in the pars variable
			}
	}
</code></pre>
<p>
Hope that helps someone out there!<br />
<a href="http://wiki.script.aculo.us/scriptaculous/show/Form.serialize">Find out more about Form.serialize() on the  script.aculo.us Wiki </a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelbox.net/2006/10/06/efficient-ajax-forms-with-prototype/feed/</wfw:commentRss>
		<slash:comments>2</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>
