Strange IE behaviour when using jQuery AJAX
Enverex
Worcester, UK Icrontian
I've been trying to make RetroTracks look a little better and decided to bring in some jQuery goodness that I had been implementing into a few of my other sites, problem is I'm running into some strange issues specifically with IE (Chrome, Firefox, Safari and even my BLACKBERRY all work fine).
Here's an example. Go to this page - http://retrotracks.net/tunes/61 - and click "Play" next to one of the tracks. In anything other than IE you'll see a loading bar (if the server hasn't cached the track) and then it'll switch to a Flash player with a download link and start playing the track (or on Blackberrys/iPhones, etc it'll use your inbuilt media player).
On IE you get the same behaviour (load bar, etc) but then you end up with an empty box rather than the Flash player. I've checked this through with Firebug Lite in IE and it shows the code is being sent back and inserted into the page, but IE simply doesn't display it. Switching to Firebug's HTML mode to show what was inserted shows the player, working. So it seems to be an IE display issue.
Anyone run into this before and know how to fix it?
Here's an example. Go to this page - http://retrotracks.net/tunes/61 - and click "Play" next to one of the tracks. In anything other than IE you'll see a loading bar (if the server hasn't cached the track) and then it'll switch to a Flash player with a download link and start playing the track (or on Blackberrys/iPhones, etc it'll use your inbuilt media player).
On IE you get the same behaviour (load bar, etc) but then you end up with an empty box rather than the Flash player. I've checked this through with Firebug Lite in IE and it shows the code is being sent back and inserted into the page, but IE simply doesn't display it. Switching to Firebug's HTML mode to show what was inserted shows the player, working. So it seems to be an IE display issue.
Anyone run into this before and know how to fix it?
0
Comments
If we look at your function you call when clicking play:
It looks like one of two things:
1. IE just is not loading the data again after you use .empty.
2. .load works fine, but it can't render the HTML (what I think it is)
I did notice: The code here seems off. The quotes are single, double, or non existent. IE is picky about this stuff.
---
Long story short, I'd try refining the html a bit..specifically the single/double quote madness there.
On that note, awesome site! I cool spot.
I'll add that in now and see if it helps, ta.
Any other ideas?
Take this code:
http://retrotracks.net/index.php?page=enco&mode=mini&folder=61&file=mod.coolp14&device=1
And make it nothing but the word TEST. Do not even use any markup.
Then see if IE shows TEST.
If it doesn't we know it is something to do with the Jquery/javascript. If it does, we can work with the markup.
--
I'm assuming it is an issue with the Jquery/javascript though. In which case I'd have to look again, and I can do that later today.
It's not exactly a lot of code:
(yes I know I'm not using &).
Looks like an IE bug to be honest as there's really nothing I can imagine being wrong here.
EDIT: Erm, why don't the CODE tags work? Meh. Replaced them with QUOTE tags instead. That also didn't work. Added 'EGG' to the tags to break them. Ok that also didn't work, the code tags clearly just don't work.
http://code.google.com/p/swfobject/
It's another .js call, but it will likely get you all sorted out.
http://jquery.thewikies.com/swfobject/examples
I believe that is the best for you
I tried the jQuery plugin which works fine in Firefox, etc but behaves exactly the same way as my original method, i.e. it works in everything except for IE where it doesn't work and is invisible (at least with this one I've got a nice way of checking for Flash, but that's beside the point)...
Any other ideas?
I can't post code here but this covers it:
http://www.w3schools.com/flash/flash_inhtml.asp
If that doesn't work I'd say it is an issue with IE not wanting to bring embed tags up through jquery.
So, this:
http://plugins.jquery.com/project/jlembed
If that fails, I give.
It appears to be an IE bug then, ah well.