Jamiesutherland.com
RSS icon Email icon Home icon
  • dojo xhrPost problems with FireFox 3

    Posted on April 15th, 2009 jsutherland 1 comment

    After working with dojo for the past few months, I’ve come across a few problems here and there and solutions to these problems. So I’ll start documenting them here as I feel I’ll be using dojo quite heaviliy in the future. Anyway, I’ve been implementing forms within dialog windows within the toolkit so that the form is submitted but the page is not refreshed. For this, you have to use dojo.xhrPost to submit the information AJAX style! the problem with this is it’s bloody confusing when you use FireFox 3 as your development browser and it never appears to post any information. A quick check with Chrome, IE and Safari proved it was an issue with FF3. So with a bit of googling I came across this http://dojotoolkit.org/forum/dijit-dijit-0-9/dijit-support/firefox-3-xhrpost-form-fail which shows that FF3 adds on an extra tag to the Content-Type header. So if like me you’ve got a standard Apache installation on ubuntu, you’ll find your forms not work correctly because this. The fix? is to add this line to your apache2.conf / httpd.conf.

    AddDefaultCharset UTF-8

    Under ubuntu it’s actually just commented out in ‘/etc/apache2/conf.d/charset’. Anyway, hope this helps someone.