My page contains flash content, and an alternative html content with its own scripting, that's why i chose loading SWFAddress with jQuery directly before creating the flash content.
The problem is that after the page loaded, the SWFAddress._load() function never executes, which breaks (among other thing) the back/forward buttons.
Tested on Firefox 3.0/Win, Firefox 3.5/Mac, where problem occurs neary every time, but it also happens sometimes in Safari 4/Mac.
These are the important parts from the index.html and swfaddress.js:
==== index.html ====
<head>
<script src="jquery.js">
<script src="swfobject.js">
<script>
$(function(){ // on dom ready
if(swfobject.hasFlashPlayerVersion('8')){
$.getScript('/scripts/swfaddress/swfaddress.uncompressed.js' // execute swfaddress
,function(){
swfobject.embedSWF('site.swf','content', etc. ); // create our flash after swfaddress has executed
});
}else{
initHTML(); //alternate html content
}
});
</script>
</head><etc>
==== swfaddress.uncompressed.js ====
var SWFAddress = new function() {
...
//here is the suggested place of fix:
//execute load instantly
if( is page already loaded? ) _load();
// if page is already loaded, _load() function won't ever initialise anything
if(window==_t) _events.addListener(document, 'DOMContentLoaded', _functions.bind(_load, this));
_events.addListener(_t, 'load', _functions.bind(_load, this));
...
}
Well, the suggested fix by me is not really working :(
Well, it does work, i forgot to include my modified/renamed js :)
Instead of
_load();
use
_load.apply(this);
like the bind() functions below it.