17488 Posts in 4473 Topics by 1978 members
| Go to End | Next > | |
| Author | Topic: | 6535 Views |
-
Firefox text/html problem

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 text/html.
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: http://groups.google.com.gi/group/Google-Maps-API/browse_thread/thread/139dddaa9f726c1b/#
-
Re: Firefox text/html problem

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"];
iFrame.document.open();
iFrame.document.write("<html>...</html>");
iFrame.document.close();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.
--Will
-
Re: Firefox text/html problem

8 June 2007 at 2:05am Last edited: 8 June 2007 9:17am
Thanks Will, I'll look into it, though I've never liked iframes too much, I suppose they are necessary sometimes.
-
Re: Firefox text/html problem

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 ?
-
Re: Firefox text/html problem

9 June 2007 at 2:03pm
Yeah; the whole text/html 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 text/html delivery when your module is used, by calling BasicAuth::disable() in the generator method for your map control.
-
Re: Firefox text/html problem

12 June 2007 at 4:35pm
Thanks guys, I'll test the BasicAuth::disable() fix and let you know how it goes.
-
Re: Firefox text/html problem

4 July 2007 at 5:19pm
The BasicAuth::disable() trick didn't do it Mandrew, but thanks for the advice.
-
Re: Firefox text/html problem

4 July 2007 at 8:11pm
To disable the xhtml/html switching try use ContentNegotiator::disable() in _config.php.
| 6535 Views | ||
| Go to Top | Next > |





