Hi,
I can't get a video to show up when I include Prototype on my page at the same time as floatbox. This only seems to happen in FF2, not in FF3 or IE6-8. Is there any work-around for this?
Here is my code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<script src="/javascripts/prototype.js" type="text/javascript"></script>
<link type="text/css" rel="stylesheet" href="/floatbox/floatbox.css" />
<script type="text/javascript" src="/floatbox/floatbox.js"></script>
</head>
<body>
<a href="http://video.google.com/googleplayer.swf?docId=-270799203995359424&hl=en&playerMode=mini" rel="floatbox" rev="width:556 height:372 scrolling:no caption:`Unquiet Visions`">Google Video (Unquiet Visions)</a>
</body>
</html>
Thanks!
John
incompatibility of videos with prototype in Firefox 2
Page: 1
Author | Post |
---|---|
johnreitano
|
#1 Thu Oct 23, 2008 7:34 pm
|
Guest | |
#2 Thu Oct 23, 2008 10:02 pm
|
|
Administrator
Registered: Aug 2008
Posts: 3382
|
Easy work-around. Don't use prototype.
But perhaps you would like a more helpful solution. The problem turns out to be not with flash in particular, but with browser detection. The presence of prototype.js breaks my browser detects for both old Firefox and old Opera. There are a few negative consequences of this. The reason it breaks is because floatbox is checking for the presence of document.getElementsByClassName. Firefox implemented this in v3.0 and Opera implemented it in 9.5. So, if floatbox doesn't find that function present, it knows it's got an earlier version of those browsers. Prototype.js adds this function to the document object if it doesn't already exist. So to floatbox these browsers start looking like their later version counterparts. For compatability with libraries that extend the document object I'll change the browser detect code. You can patch this in to your current version 3.20 of floatbox.js (and framebox.js) if you like. Obviously, if you're using the gzipped version, you will need to rezip after making the change. Here's the old and new code to replace: Existing v3.20 code: this.mac = navigator.appVersion.indexOf('Macintosh') !== -1; Replacement code: var agent = navigator.userAgent, |
johnreitano
|
#3 Fri Oct 24, 2008 6:55 am
|
Guest |
Thank you! That solved it!
|
johnreitano
|
#4 Fri Oct 24, 2008 6:23 pm
|
Guest |
Woops...found a new small syntax error in the code above. I believe the fix is to change "substr(str.indexOf" to "substr(version.indexOf" in the two places where it occurs.
|
#5 Fri Oct 24, 2008 6:30 pm
|
|
Administrator
Registered: Aug 2008
Posts: 3382
|
Doh!
Thanks for catching that. I've updated the replacement code in the post above. Apologies for the sloppy work. |
Page: 1