Closed (fixed)
Project:
Javascript Tools
Version:
5.x-1.x-dev
Component:
Tabs
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Dec 2007 at 15:19 UTC
Updated:
21 Nov 2008 at 14:43 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
jdsaward commentedBy scientific method (or was it trial and error?) I also confirmed that it is the tabs helper module that causes IE to abort. IE7. Using 5.x-0.8.
Comment #2
buddaThe crash happened because of code within a JS script called jquery.history_remote.min.js
What this script does it's what would be called a "hack"... under IE it requires making changes to the page (adding an invisible IFRAME). Normally, when you dynamically make changes to a page you're advised to do it inside an "onload" handler... otherwise things might go wrong. In practice things don't normally go wrong... except when Flash is around in which case you might or might not have problems (the reason why is hidden along with IE's source code). The thing is, "onload" is an event called after the whole page (and images) are loaded and rendered... which is overkill, because it'd be enough to wait until the DOM is loaded, no need to wait for images. Firefox provides a "dom loaded" event, but IE doesn't.
... enter the JQuery library, used by Drupal (and by the guilty script in particular), which provides a hook for Firefox's "dom loaded" event, and attempts to simulate it under IE (I'm talking about the $.ready function).
The Fix is in jquery.history_remote.js which is loaded by the tabs code for the permalink urls.
I have attached the fixed script.
Comment #3
Anonymous (not verified) commentedBudda,
I've replaced my jquery.history_remote.pack.js file with your text file and while I no longer get the IE aborted error, tabs no longer work. Is there anyway I could just disable the history script from running? Tabs don't seem like something that really needs them to function.
Thanks!
Comment #4
nedjoThe D6 version of tabs doesn't have history. Yes, probably we should either remove it from D5 or else at least make it optional. I'd welcome a patch.
Comment #5
Anonymous (not verified) commentedBudda,
I need to correct myself. Your patch didn't break the tabs, but by moving that iframe creation to window.onload, my script that was set to run ondomload ended up running too early. Moving my initiation script for the tabs to window.onload fixed the problem. Awesome!
Comment #6
Anonymous (not verified) commentedAny tips on how to do this in the code? I see the javascript, I just can't get my head around what needs to be removed/made optional.
Comment #7
budda@klamping - not sure what you're asking? What do you want to make optional?
Comment #8
Anonymous (not verified) commentedI'd like to stop the history script from running altogether, since it's cause conflicts with my jquery photo carousel script. So I was wondering if there was anywhere I could just stop the call to that script from being made.
Comment #9
wmostrey commentedHere is what fixed the problem for me:
http://drupal.org/node/199524#comment-827965
Either use the altered jquery.history_remote.js (attached to that comment) or change the module and stop it from calling it altogether. The Drupal 6 version of the module doesn't use it anymore btw.
This bug really should be taken seriously by the maintainers of this module.
Comment #10
nedjoI haven't reproduced the issue and so cannot fully test. Comment #3 reported that the patch broke tabs.
I'd welcome a patch with reviews.
Comment #11
wmostrey commentedThe error happens when you combine this script with for instance reCAPTCHA or swfobject.js. You should be able to reproduce it when you enter one of those objects in your page.
Comment #12
wmostrey commentedBudda,
Your script fixes the "cannot open" error but it effectively breaks tabs. Do you know what else needs to be changed in order to get them working again?
Comment #13
wmostrey commentedI can confirm this bug for 5.x-1.1 as well.
For better understanding I created a patch for #2's solution (patch for 0.8). All we need now is a way to figure out how to get tabs working again with this patch applied.
Comment #14
wim leersSo, in summary:
- no crash anymore when you use $(window).load instead of just $() (which is a synonym for $.ready), which caused it the history plugin to be loaded too early in IE6, in turn causing weird problems when combined with Flash on the same page
- the history is now being loaded later, but the tabs plugin isn't, which somehow causes it to fail. So we need to make sure the tabs plugin only loads *after* the history plugin has loaded.
How about:
- add an id attribute to the iframe that's being added by the history plugin
- don't load the tabs plugin until the aforementioned id is found
Seems the least hacky approach?
Comment #15
nmorse commentedSo, I'm confused -- as I don't have a jsquery.history_remote.js -- I haae jsquery.history_remote.pack.js, which doesn't look anything like the patch. What am I missing?
Comment #16
wmostrey commentedNick, the patch is for version 0.8 (which uses history_remove.js), not for version 1.1 (which uses history_remote.pack.js).
After more testing, it looks like my patch for #13 by itself fixes this issue without breaking tabs. It would be great if someone could confirm this.
Comment #17
sjs commentedI have the 1.1 version of jstools, so the above mentioned patch wasn't of much use. What did work for me was commenting out line 160 in tabs.module:
drupal_get_path('module', 'jstools') . '/jquery.history_remote.pack.js',
So far I haven't seen any side effects. Those parts of the site that use tabs work just like they did before and the error message is gone..
Comment #18
nedjoI made the history remote plugin optional, defaulting to disabled.
Comment #19
wmostrey commentedThanks so much for this Nedjo!