MIME problem with javascript

Please use my SitePoint thread Flickr badge not working with xml MIME type if you have more comments about this issue.

Aug2 Update: Now testing IOTBS. See example 3 for a new implementation of a style-sheet switcher.

Jul29 Update: Small CSS changes turn the flicker on and off. Well, I've been making random small changes to my css the past couple of days and then all of the sudden I noticed that there's no more flicker to flickr. After some other random changes, the flicker is back, so I'm getting quite annoyed! I've found that when I have both #wrap div (see default.css) and style-switcher JavaScript (see example 2), the Flickr badge usually does its flicker.

Jul27 Update: Badge still “flickering” in Firefox! This is a conflict with the style switcher that I'm testing - argh.... I'll investigate ASAP. See a trimmed-down version of the problem on the working example 1 and usually broken example 2 (see Jul29 update).

Jul15 Update: XML makes things too difficult. Instead of using complicated objects with XML, I'm going to stick with good old valid HTML 4.01 Strict, which is just as good as XHTML for 99% of webpages - thanks, Anne, for your Quick guide to XHTML (and Rated XHTML from Peter-Paul Koch in 2000 still seems applicable)! Here is the OBJECT code that I was using: flickrobj.txt (view source). For future compatibility, I'm actually coding my pages in XHTML, but converting them to HTML with this PHP file: mime.txt; this way, I can occasionally "validate" the XHTML of my pages by doing a quick change to my mime header. Thanks to Tommy Olsson who replied to my email and gave me some good tips; I also used many of his suggestions from Content Negotiation.

'05Jun24 Update: Fix not working perfectly! Others do not have this problem, but I've noticed that, the Flickr badge is forcing its parent page to load twice. When I hit the Back arrow on the browser, it doesn't go anywhere. I have to look at the Back history and go back two pages. Additionally, if you click on the Flickr photo(s) in the badge, they open within the tiny object window, not within the whole browser page.

The partial solution: I have yet to wrap my brain around the xml xhtml MIME type stuff, but I at least got the Flickr badge working (thanks as usual to another fabulous article on 456 Berea, which referenced a similar Adsense issue fix). I modified the Adsense instructions to match my Flickr badge. I simply added this text in the XHTML of my main document and included this php file link. On to the original post….

I haven't tried pasting any other javascript in to test, but my Flickr badge does not want to display when I serve this page with the <?xml version='1.0' encoding='UTF-8' ?> header. The badge does work, though, if I use <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" /> (IE shows the badge either way because I'm pretty sure it ignores the application/xhtml+xml; my concern is about standards-compliant browsers that are actually serving the xml correctly). Does javascript not work with xml? Compare the non-working flickr header on the right with a similar one on my test megs'n'jj page. mime.txt is currently the same as my mime.php file if you'd like to look at it. I've posted help topics about this on Flickr and SitePoint. [See also Serving XHTML with the correct mime type using PHP, where I've commented, as well.]

Navigation

You are currently in the About section of Zepfanman.com. This page is part of the testing ground for my new beta site, discussing one of the issues I'm having with the following Flickr badge I'd like to use.

Featured photos

Alternative formats