Tyranwyn
Tyranwyn

Reputation: 53

Upgrade jQuery 1.7.3 to 1.8.0+ Syntax error [data-role]=page] (in combination with jQuery Mobile)

So I'm trying to upgrade the jQuery of my mobile website from 1.7.3 to anything above 1.8 but when I do this I get this console error:

[Error] Error: Syntax error, unrecognized expression: [data-role]=page              error (jquery-1.8.0.js, line 4512)
tokenize                                                                                  (jquery-1.8.0.js, line 4785)
compile                                                                                   (jquery-1.8.0.js, line 4883)
select                                                                                    (jquery-1.8.0.js, line 4973)
select                                                                                    (jquery-1.8.0.js, line 5083)
Sizzle                                                                                    (jquery-1.8.0.js, line 3912)
find                                                                                      (jquery.mobile-1.3.2.js, line 348)
matchesSelector                                                                           (jquery.mobile-1.3.2.js, line 358)
filter                                                                                    (jquery-1.8.0.js, line 5371)
is                                                                                        (jquery-1.8.0.js, line 5218)
dispatch                                                                                  (jquery-1.8.0.js, line 3027)
eventHandle                                                                               (jquery-1.8.0.js, line 2677)
trigger                                                                                   (jquery-1.8.0.js, line 2941)
(anonymous function)                                                                      (jquery-1.8.0.js, line 3607)
each                                                                                      (jquery-1.8.0.js, line 611)
each                                                                                      (jquery-1.8.0.js, line 241)
trigger                                                                                   (jquery-1.8.0.js, line 3606)
_trigger                                                                                  (jquery.mobile-1.3.2.js, line 835)
(anonymous function)                                                                      (jquery.mobile-1.3.2.js, line 4065)
fire                                                                                      (jquery-1.8.0.js, line 973)
add                                                                                       (jquery-1.8.0.js, line 1016)
transitionPages                                                                           (jquery.mobile-1.3.2.js, line 4058)
changePage                                                                                (jquery.mobile-1.3.2.js, line 4708)
initializePage                                                                            (jquery.mobile-1.3.2.js, line 11158)
(anonymous function)                                                                      (jquery.mobile-1.3.2.js, line 11192)
fire                                                                                      (jquery-1.8.0.js, line 973)
fireWith                                                                                  (jquery-1.8.0.js, line 1080)
ready                                                                                     (jquery-1.8.0.js, line 406)
DOMContentLoaded                                                                          (jquery-1.8.0.js, line 83)

The result of this error is that i can't do anything. I can't switch pages and iScroll doesn't work either.

I have no idea where the error could be in my code since I don't see an error reference to anything else than the jQuery Library, so I don't really know what code to put here. It's not a code that I have written myself. Cheers :)

Upvotes: 0

Views: 202

Answers (1)

Sga
Sga

Reputation: 3658

It seems there is a misspelling in a selector, it should be [data-role=page] (please search for it in the source code).

While you're at it, be sure to upgrade to the latest jQuery supported by JQM 1.3.2:

<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css" />
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>

Upvotes: 0

Related Questions