Active
Project:
jQuery Mobile module
Version:
7.x-2.0-beta1
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Jul 2012 at 22:55 UTC
Updated:
14 Oct 2013 at 21:16 UTC
My custom javascrip on a does not load until I reload the page.
my js is attached to a form in a custom module. I can fix it in two ways:
1. Disable ajax
2. Sett Link Binding Enabled (linkBindingEnabled) to false
But both ways seem to change the smooth behaviors and I lost the 'loading" dialog box.
Please let me know if there is a proper way of adding custom js.
Comments
Comment #1
minoroffense commentedCan you give me more details on what/how you're adding the js?
Are you using the '#attached' FAPI option? http://api.drupal.org/api/drupal/developer!topics!forms_api_reference.ht...
When you refer to disable ajax, you mean in the jquery mobile settings correct?
Comment #2
Schoonzie commentedI think I'm having the same problem.
I'm using jQM with Ubercart. On the Ubercart /cart/checkout page it adds another javascript file to handle a few actions on the checkout form (change the Region options when the Country is changed).
Because jQueryMobile only loads the content from within the data-role="page" container when it changes pages, any new scripts or css files that are added on subsequent pages are ignored.
This page has a little more info on it:
I'm not sure if this is within the scope of the module or not.
A dodgy way to get around this is to print all the scripts and styles in the body of the page. Eg
A better way would be to try and remember what scripts were loaded in the first page load and then only print the additional ones to the body on subsequent pages.
Comment #3
mattsmith3 commentedSame issue here. We added js in the .info file. Turning off ajax fixes as well, but looses the smooth transitions as described above.
Comment #4
jordan8037310 commentedAlso experiencing this issue except when I try to turn off Ajax it doesn't save the settings... Will report back with more info soon.
Comment #5
jordan8037310 commentedOkay, settings issue was actually this other issue: https://drupal.org/node/1837722
However, still experiencing this issue and turning off AJAX doesn't seem to have any effect.
Any one else experiencing this?
Comment #6
kscheirer@mattsmith which .info file? jquerymobile's? This definitely looks like it needs work.