Thursday, June 14, 2007

Information Literacy Game Problem

A few people attempting to adapt the Game for their library have written to tell me that they get errors when they try to run the game. I think I've finally isolated the problem.

It appears that some servers do not set the response headers correctly for the XML files that hold the questions. The header is set as text/plain rather than text/xml, which causes the browser to go wonky when it's looking for XML to come back and the server tells it that it's getting text.

There are a few possible solutions. The first, and best solution, involves speaking to the person who administers the web server you have placed the files on and explaining that they need to set the MIME type of files with the .xml extension to be sent as application/xml or text/xml.

The second, which is an incomplete fix, is to paste the following into your newgame.html file:
try {xmlhttp.overrideMimeType('text/xml');}
catch(e){};

Place that little bit of javascript right after the part that reads:
xmlhttp.open("GET", url, true);

This should fix the problem in Mozilla Firefox and Internet Explorer 7. I'm not certain if that will help those with Internet Explorer 6. I am looking for other fixes which might help there.

1 comment:

Anonymous said...

Hello!!! librarygames.blogspot.com is one of the best innovative websites of its kind. I enjoy reading it every day. Keep it that way.