Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

Firefox application/xhtml+xml problem

Go to End

9 Posts   7907 Views

Ofir Picazo

Google Summer of Code Hacker, 7 Posts

7 June 2007 at 5:49pm

I've come across a very odd problem with Firefox, seems like it changes the js functions available when using xhtml+xml doctype. I found that out when trying to use GoogleMaps on a Silverstripe site who served application/xhtml+xml.
An easy fix is to remove the first line on the default template:

<?xml version="1.0" encoding="UTF-8"?>

That will make Silverstripe serve text/html instead.

More Info:


Google Summer of Code Hacker, 7 Posts

7 June 2007 at 6:34pm

Have you looked into making an iFrame to hold the map stuff?

It ought to be possible to make an iFrame to override the content type, and then write your map stuff in there.

The easy way to do this would be to have the iFrame actually be on the page with no source set, for example
<iframe id="iframe_id" src="" type="text/html"></iframe>

Then JavaScript could populate it with code along the lines of:

var iFrame = document.frames["iframe_id"];;

the 'iFrame.document' code only works in some browsers, but there are equivalents to it in pretty much everything.

It's also possible to both create and populate the iFrame in javascript, though it takes a bit more work; that method gives a bit more control over dynamic sizing stuff.

Hope this is helpful.


Ofir Picazo

Google Summer of Code Hacker, 7 Posts

8 June 2007 at 2:05am

Edited: 08/06/2007 9:17am

Thanks Will, I'll look into it, though I've never liked iframes too much, I suppose they are necessary sometimes.


Google Summer of Code Hacker, 76 Posts

8 June 2007 at 9:17am

Ofir, are u using javascript on the page under a CDATA block ?

The problem of Silverstripe using XHTML+Xml rather than text/html is when working with the external API's where we don't have any control of produced output.

Is there any way to strip html special characters of the variables used in templates ?


Community Member, 37 Posts

9 June 2007 at 2:03pm

Yeah; the whole application/xhtml+xml thing is a bit of a bug-bear. It's a sad truth that much of the world isn't ready for XHTML - even the developers at Google!

You could also disable the application/xhtml+xml delivery when your module is used, by calling BasicAuth::disable() in the generator method for your map control.

Ofir Picazo

Google Summer of Code Hacker, 7 Posts

12 June 2007 at 4:35pm

Thanks guys, I'll test the BasicAuth::disable() fix and let you know how it goes.

Ofir Picazo

Google Summer of Code Hacker, 7 Posts

4 July 2007 at 5:19pm

The BasicAuth::disable() trick didn't do it Mandrew, but thanks for the advice.


Forum Moderator, 5523 Posts

4 July 2007 at 8:11pm

To disable the xhtml/html switching try use ContentNegotiator::disable() in _config.php.

Go to Top