Forum Moderators: open

Message Too Old, No Replies

Conflict between EMBED tag and jquery history

         

Marfola

12:27 pm on Feb 19, 2010 (gmt 0)

10+ Year Member



We use the jquery history plugin to fix the back button on Ajax pages. We use the embed tag to load flash on an Ajax page. Unfortunately there is a conflict between the two in IE.

When I load flash content on an ajax page the meta title is modified to include the hash value of the url even if I don’t modify the title in my code. If load the Ajax content via another tag the meta title shows properly.

Has anyone encountered this problem? Do you know of a workaround? I’d like to continue using the embed tag as it reduces the latency of my initial page load.

Marfola

3:24 pm on Feb 24, 2010 (gmt 0)

10+ Year Member



Of note the conflict (IE only) also occurs with the jquery plugin "hashchange" as well as the "jQuery BBQ hashchange basic" plugin.

Does anyone have a work around? I'd like to use the embed tag as its HTML5.

Fotiman

4:00 pm on Feb 24, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I'm not sure I understand the problem. Could you perhaps post a small snippet of code that demonstrates the problem?

Marfola

3:14 pm on Feb 25, 2010 (gmt 0)

10+ Year Member



Thanks Fotiman
The conflict occurs in the following situation.
I load flash content with the embed tag on an ajax page that uses a history plugin such as jquery hashchange(http://code.google.com/p/footprint2009dev/source/browse/trunk/frontend/js/jquery.hashchange-1.0.0.js?spec=svn409&r=337)
Here's what happens with the meta tag:
The hash value is added to the meta tag.
"Document Title" becomes "Document Title#newpage" when I activate the flash and remains for the rest of the navigation.
Note: Nothing else that I load via AJAX (HTML, images, inline-script etc ...), causes this problem. The meta error only happens when if I use the embed tag without the object tag on an ajax page with a history plugin. When I remove the history plugin, the embed tag works perfectly without the object tag even in ie8. As mentioned in my previous post, I’d like to continue using the embed tag without the object tag as it reduces the latency of my initial page load.
Here's the Javascript:

// by clicking on a button AJAX is called
$('#ajaxButton').click(function(e)
{
$.locationHash(hash);
if (hash != lastHash){
lastHash = hash;
pageload(hash); // function which invoke the AJAX
}
});

// onhashchange (f.e. BACK button) AJAX is called
$(document).ready(function() {
$(window).hashchange(function() {
var hash = location.hash;
if (hash != lastHash){
lastHash = hash;
pageload(hash) // function which invoke the AJAX
}
});
});


And here’s my flash code which I load via AJAX:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab" id="Player_12121f79-0ce8-4ce6-b3df-fdbec7914ea9" width="160px" height="600px"><param name="movie" value="<flash_url>"><param name="quality" value="high"><param name="bgcolor" value="#f8f8f8"><param name="allowscriptaccess" value="always"><param name="wmode" value="transparent"></object>

Marfola

9:22 am on Feb 26, 2010 (gmt 0)

10+ Year Member



Sorry, but the flash code which I load via AJAX that cause the conflict is:

<embed src="<flash_url>" width="160" height="500" wmode="transparent" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />