Closed (works as designed)
Project:
jQuery Update
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
1 May 2010 at 07:54 UTC
Updated:
21 May 2010 at 07:48 UTC
When using modal with iframe, jquery_update is not available anymore. Instead it reverts to the old default jquery. Some codes relying on new version (1.3 above) inside the modal is then not supported anymore, such as when I use "live" event.
So is it possible to fire jquery_update at all time? Perhaps via hook_init, or is there any bad consequence that I am not aware of with init?
Sorry if this is deep somewhere already in the issues.
Thanks for consideration.
Comments
Comment #1
gausarts commentedBetter title :)
Comment #2
mfer commentedjQuery Update replaces jQuery at render time. It fires off a preprocess function to rebuild the scripts with the replaced scripts. You cannot swap out one jQuery version for another in a normal hook.
What jQuery Update does is a bit of a hack. Having to hack around this is what caused changes in Drupal 7 to make this easier and cleaner.
What module (link please) is causing the problem? It may be adding the jquery in a non-stand way to altering the rendering path. This issue may be with that module.
Comment #3
gausarts commentedI played around with imagebrowser and added a couple of things inside the browser frame using stuffs supported only by jQuery 1.3 above before I managed to convert it into non-framed modal cTools which is successfully keeping the replacements.
But the question above remains, in case I will still need frames for some unavoidable stuffs :) If you look into the frame source, there are no more replacements. I just don't want to rely on another module to load the jquery_update yet, if possible, since drupal default jquery is always loaded anywhere.
Thanks
Comment #4
markus_petrux commentedI think the problem may arise if you are not using theme('page') to render the contents of the iframe. This is because jquery_update does its job using page template preprocess code, which is different from your iframe preprocess stuff.
I had the same problem when working with Modal Frame API, but I solved that re-using the page preprocess stuff in a quite tricky way. This is explained in the code itself, which you can see here:
http://drupalcode.org/viewvc/drupal/contributions/modules/modalframe/mod...