Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

JQM Beta1 theme switcher and jqm-docs.js clash with Prototype libraries #2013

Closed
agcolom opened this issue Jul 3, 2011 · 5 comments
Closed

Comments

@agcolom
Copy link
Contributor

agcolom commented Jul 3, 2011

Hi,

I am creating a sortable list in JQM and I want to also use the Prototype libraries to give a 'pulsate' effect when the order is correct. I use jQuery to make the list sortable and use jQuery for jQuery and $ for Prototype. (In the full code I use jQuery.noConflict() to 'give the $ back to Prototype). All that works fine with Alpha 4, and even beta1 if the jqm-docs.js is removed.

I have created a fiddle: http://jsfiddle.net/agcolom/ZCxBU/

I have reduced the code to bare minimum for clarity, so the prototype libraries are included but not used. This is enough to cause the problem. If you remove the comments around jqm-docs.js, you will get an error:

Error: $("body") is null
Source File: http://jquerymobile.com/demos/1.0b1/docs/_assets/js/jqm-docs.js
Line: 32

(i believe it associates the $ with Prototype and not with jQuery?) It may be that prototype should be used with a specific namespace?

Many Thanks,

Anne-Gaelle

@toddparker
Copy link
Contributor

You'd need to run jQuery in no conflict mode to work this way but it seems like a real waste of bandwidth and js overhead to include prototype for a pulsate effect when there are a by CH of jQuery plugins that do the same thing. Closing because this is really a better item for the forums.

@agcolom
Copy link
Contributor Author

agcolom commented Jul 6, 2011

ok, no problem. I was actually more interested from an academic point of view how JQM can be used with other libraries such as prototype (I will teach JQM in Sept to 140 students in 2nd and 3rd year so I'm bound to have that issue coming up). Would you recommend to stick to JQuery with jQuery Mobile?

Thanks,

@toddparker
Copy link
Contributor

Yep, well jQuery Mobile requires jQuery core so that is the baseline. You can run jQuery in no conflict mode with other libraries but that would be very heavy from both a bandwidth and processing perspective so we would recommend it if avoidable.

@agcolom
Copy link
Contributor Author

agcolom commented Jul 6, 2011

Great, That's really useful info, thanks for your answer. BTW, if you are interested in getting my students to test something in particular around october to december, I'm happy to get them to grab screen shots of their device accessing one of your pages or sites. We are in London, UK, so the mobile devices used here may be a bit different to US based collection. Just let me know :-)

@toddparker
Copy link
Contributor

Great, thanks for the offer!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants