ajaxFormsEnabled = false / caching?
Please excuse my ignorance on this but I am tired of fighting this. I need to do a file upload on one of my JQuery Mobile pages. I'm doing this in .NET MVC 3, just for the record.
I have four pages, A, B, C, and D. A, B, and D gather info and/or save stuff. Page C does the upload.
I know that I need to disable ajaxForms in order to accomplish the upload. So below is how I have my javascript stuff setup in the <head> for each page.
PAGE A
- <script src="http://code.jquery.com/jquery-1.5.min.js"></script>
- <script src="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.js"></script>
PAGE B
same as above
PAGE C
- <script src="http://code.jquery.com/jquery-1.5.min.js"></script>
- <script type="text/javascript" src="../../../../Scripts/my-noajax.js"></script>
- <script src="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.js"></script>
where my-noajax.js contains the following:
- $(document).bind("mobileinit", function () {
- //apply overrides here
- $.mobile.ajaxLinksEnabled = false;
- $.mobile.ajaxFormsEnabled = false;
- });
PAGE D
same as A and B
If I navigate normally into the site through pages A, then B, and then C it caches the <head> declarations from A and carries them to C. So the my-noajax.js doesn't happen.
If I enter the site directly to page C all is good.
What can I do to keep this from happening?
Thanks!
Steve