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

jQuery Mobile + UI: Uncaught TypeError (1.2.0 alpha) #4805

Closed
idangozlan opened this issue Aug 6, 2012 · 19 comments
Closed

jQuery Mobile + UI: Uncaught TypeError (1.2.0 alpha) #4805

idangozlan opened this issue Aug 6, 2012 · 19 comments

Comments

@idangozlan
Copy link

hey,

im trying to use 1.2.0 alpha uncompressed and its throw exception..
link - http://code.jquery.com/mobile/1.2.0-alpha.1/jquery.mobile-1.2.0-alpha.1.js

thanks!

@jaspermdegroot
Copy link
Contributor

@idangozlan

This basic test page uses 1.2 alpha, but I don't see any errors: http://jsbin.com/atahip/42.
Can you provide a test page and information about what platform/browser you tested?

@idangozlan
Copy link
Author

Hey, its a local webpage so i cant provide you link, but i run by chrome latest version, and get the following error

Uncaught TypeError: Object function (b,c,d){var e=b.split(".")[0],f;b=b.split(".")[1],f=e+"-"+b,d||(d=c,c=a.Widget),a.expr[":"][f]=function(c){return!!a.data(c,b)},a[e]=a[e]||{},a[e][b]=function(a,b){arguments.length&&this._createWidget(a,b)};var g=new c;g.options=a.extend(!0,{},g.options),a[e][b].prototype=a.extend(!0,g,{namespace:e,widgetName:b,widgetEventPrefix:a[e][b].prototype.widgetEventPrefix||b,widgetBaseClass:f},d),a.widget.bridge(b,a[e][b])} has no method 'extend' jquery.mobile-1.2.0-alpha.1.js:561

@MauriceG
Copy link
Contributor

MauriceG commented Aug 6, 2012

HI @idangozlan

Please check if jQuery is loaded successfully before jQM: <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>

Maurice

@idangozlan
Copy link
Author

yes its loaded..

@idangozlan
Copy link
Author

The problem has solved when i removed jQuery UI js..
jquery-ui-1.8.21.custom.min.js

@MauriceG
Copy link
Contributor

MauriceG commented Aug 6, 2012

@idangozlan

as far as I know: "These two libraries aren't designed to play together"

@jaspermdegroot
Copy link
Contributor

It's true that you might run into some issues if you use both Mobile and UI, but maybe an error like this can be prevented.

It seems there is a conflict because both jQuery Mobile and jQuery UI contain the Widget Factory.

@gseguin @johnbender - Can you take a look at this issue?

@johnbender
Copy link
Contributor

Yah I'll take a look at this one.

On Mon, Aug 6, 2012 at 6:23 AM, Jasper de Groot <
reply@reply.github.com

wrote:

It's true that you might run into some issues if you use both Mobile and
UI, but maybe an error like this can be prevented.

It seems there is a conflict because both jQuery Mobile and jQuery UI
contain the Widget Factory.

@gseguin @johnbender - Can you take a look at this issue?


Reply to this email directly or view it on GitHub:
#4805 (comment)

@istrasoft
Copy link

I have a similar issue, only on latest Chrome on Win7 with also

Uncaught TypeError:method "addClass" not specified.

Got it on a page that was perfectly working on JQM 1.1.1 and that is not using jquery UI.

Also, no error on iOS Safari and Chrome, no error on Win7 Firefox or Safari.

@jaspermdegroot
Copy link
Contributor

@istrasoft

Since you don't use UI your issue not really related to this one. Can you open a new ticket and provide a test page? Thanks!

@jaspermdegroot
Copy link
Contributor

@idangozlan @johnbender - FYI: I changed the topic of this ticket.

@istrasoft
Copy link

@uGoMobi Ok well I can't seem to isolate the issue. in jsFiddle it works fine even though I didn't change a thing. let's forget it ;)

@outsmartin
Copy link

got exactly the same problem, im using UI for its autocompletion only

@jamiegp
Copy link

jamiegp commented Aug 22, 2012

Hi all,

I have exactly same bug trying to combine UI Autocomplete with 1.2.0 Alpha.

I think I've narrowed it down to a conflict with the "Widget UI Core" component.

@jamiegp
Copy link

jamiegp commented Aug 22, 2012

And now it's fixed. Not sure what changed 1.2.0 Alpha, but if I load autocomplete before jquerymobile, it fixes the issue. Panic over :)

@jds13
Copy link

jds13 commented Oct 18, 2012

I fixed this by removing jquery.ui.widget.js which was probably required at some time in the distant past:

@jaspermdegroot
Copy link
Contributor

@jds13

It's not that UI doesn't require jquery.ui.widget.js (widget factory) anymore. It's just that it's included - and needed - in Mobile as well. If you load UI before Mobile this is causing a conflict. Note that the version of the widget factory code can be different among both frameworks.

@teo1978 teo1978 mentioned this issue Jun 2, 2013
@teo1978
Copy link

teo1978 commented Jul 16, 2013

Though the issue is fixed with the latest jqm together with the latest jui and latest jquery,
the issue still exists with some older versions of Jquery core and jquery UI (still with jqm 1.3.1).

I've experienced it with one (or both) of the following combinations, but I'm not sure which one (if not both):
jqm 1.3.1 + jUI 1.8.22 + jquery 1.7.2
jqm 1.3.1 + jUI 1.8.17 + jquery 1.7.1

I don't have a jsbin (sorry), but on the site where I had the issue with one of the above combinations, I fixed it by just replacing jui and jquery with more recent versions (jui 1.9.2 and jquery 1.8.3) without touching a single line of code.

@lastravex
Copy link

Confirmed this issue still exists with:
jqm 1.4.0-beta.1 + jQuery UI 1.8.11 + jQuery v1.7.1
jqm 1.3.0 + jQuery UI 1.8.11 + jQuery v1.7.1
jqm 1.2.0 + jQuery UI 1.8.11 + jQuery v1.7.1

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