Select to view content in your preferred language

Zoom slider doesn't load for sites in XML Mode in Firefox/Chrome.

449
0
01-05-2011 05:21 AM
JohnTurner
New Contributor
Hi,

I'd been baffled by this one for a couple days and it's taken quite a while to track down exactly what was going on.

We're working on a project in Lift (a Scala based webframework), which for some good reasons (see http://hsivonen.iki.fi/doctype/ ) defaults to serving pages with a content-type of "application/xml+xhtml".  This puts browsers into a "XML mode", which restricts some actions on the DOM which are valid in the various HTML modes.

While the maps mostly work in XML mode, attempting to turn on the zoom slider causes a DOM Exception 7 in Chrome and a different error in Firefox and doesn't appear, I couldn't really track this down any further in the compressed version of the js the API provides. 

I've set up a simple demonstration of the problem at http://dev.mhnltd.co.uk/norgg/maptest.xhtml and http://dev.mhnltd.co.uk/norgg/maptest.html .  These are actually the same symlinked file, but served up with different content-types by apache due to the different file extensions.

For now we've worked around this for ourselves by changing the content type, but it would be nice if this could be fixed.  If anyone else has the same problem in Lift, the necessary line for your Boot.scala file to switch to "text/html" as the default content-type is:

LiftRules.useXhtmlMimeType = false
0 Kudos
0 Replies