Refreshing a page with #&ui-state=dialog causes syntax error #2570

Closed
mdarnall opened this Issue Sep 29, 2011 · 12 comments

Comments

Projects
None yet
9 participants
@mdarnall

This is happening with the release of RC1. Just visiting this URL in chrome:

http://jquerymobile.com/demos/1.0rc1/docs/pages/page-dialogs.html#&ui-state=dialog

gives a js error:

Uncaught Syntax error, unrecognized expression: #

@ghost ghost assigned jblas Sep 29, 2011

@jblas

This comment has been minimized.

Show comment
Hide comment
@jblas

jblas Sep 29, 2011

Contributor

Note the URL is the pushstate plugin re-written URL.

Contributor

jblas commented Sep 29, 2011

Note the URL is the pushstate plugin re-written URL.

@scottjehl

This comment has been minimized.

Show comment
Hide comment
@scottjehl

scottjehl Sep 29, 2011

Contributor

Hmm yeah verified. This was fine in B3, with pushstate enabled. http://jquerymobile.com/demos/1.0b3/docs/pages/page-dialogs.html#&ui-state=dialog

Contributor

scottjehl commented Sep 29, 2011

Hmm yeah verified. This was fine in B3, with pushstate enabled. http://jquerymobile.com/demos/1.0b3/docs/pages/page-dialogs.html#&ui-state=dialog

@jblas jblas closed this in 4781217 Sep 29, 2011

jblas added a commit that referenced this issue Sep 30, 2011

Added a test for diretly loading Urls with a hash that contains just …
…the dialogHashKey. This tests to make sure these issues don't happen again:

Issue #2570 - Refreshing a page with #&ui-state=dialog causes syntax error
Issue #2582 - Refreshing a page with #&ui-state=dialog causes page duplication
@adaptabi

This comment has been minimized.

Show comment
Hide comment
@adaptabi

adaptabi Jan 23, 2012

Contributor

I'm still getting the error with jquery 1.7.1
Both on chrome and on safari mobile.

Uncaught Error: Syntax error, unrecognized expression: #&ui-page=0-0
Sizzle.errorjquery-1.7.1.js:4179
Sizzle.filterjquery-1.7.1.js:4165
Sizzlejquery-1.7.1.js:3955
Sizzlejquery-1.7.1.js:5083
$.findjquery.mobile-1.0.js:1936
$.find.matchesjquery.mobile-1.0.js:1942
jQuery.extend.filterjquery-1.7.1.js:5548
jQuery.each.jQuery.fn.(anonymous function)jquery-1.7.1.js:5527
$.mobile.loadPagejquery.mobile-1.0.js:2688
$.mobile.changePagejquery.mobile-1.0.js:2974
$.mobile._registerInternalEvents.$.mobile._handleHashChangejquery.mobile-1.0.js:3428
$.mobile._registerInternalEventsjquery.mobile-1.0.js:3437
jQuery.event.dispatchjquery-1.7.1.js:3256
jQuery.event.add.elemData.handle.eventHandlejquery-1.7.1.js:2875
jQuery.event.triggerjquery-1.7.1.js:3144
jQuery.fn.extend.triggerjquery-1.7.1.js:3781
jQuery.extend.eachjquery-1.7.1.js:658
jQuery.fn.jQuery.eachjquery-1.7.1.js:271
jQuery.fn.extend.triggerjquery-1.7.1.js:3780
$.extend.initializePagejquery.mobile-1.0.js:6861
(anonymous function)jquery.mobile-1.0.js:6900
jQuery.Callbacks.firejquery-1.7.1.js:1046
jQuery.Callbacks.self.fireWithjquery-1.7.1.js:1164
jQuery.extend.readyjquery-1.7.1.js:435
DOMContentLoadedjquery-1.7.1.js:923

Contributor

adaptabi commented Jan 23, 2012

I'm still getting the error with jquery 1.7.1
Both on chrome and on safari mobile.

Uncaught Error: Syntax error, unrecognized expression: #&ui-page=0-0
Sizzle.errorjquery-1.7.1.js:4179
Sizzle.filterjquery-1.7.1.js:4165
Sizzlejquery-1.7.1.js:3955
Sizzlejquery-1.7.1.js:5083
$.findjquery.mobile-1.0.js:1936
$.find.matchesjquery.mobile-1.0.js:1942
jQuery.extend.filterjquery-1.7.1.js:5548
jQuery.each.jQuery.fn.(anonymous function)jquery-1.7.1.js:5527
$.mobile.loadPagejquery.mobile-1.0.js:2688
$.mobile.changePagejquery.mobile-1.0.js:2974
$.mobile._registerInternalEvents.$.mobile._handleHashChangejquery.mobile-1.0.js:3428
$.mobile._registerInternalEventsjquery.mobile-1.0.js:3437
jQuery.event.dispatchjquery-1.7.1.js:3256
jQuery.event.add.elemData.handle.eventHandlejquery-1.7.1.js:2875
jQuery.event.triggerjquery-1.7.1.js:3144
jQuery.fn.extend.triggerjquery-1.7.1.js:3781
jQuery.extend.eachjquery-1.7.1.js:658
jQuery.fn.jQuery.eachjquery-1.7.1.js:271
jQuery.fn.extend.triggerjquery-1.7.1.js:3780
$.extend.initializePagejquery.mobile-1.0.js:6861
(anonymous function)jquery.mobile-1.0.js:6900
jQuery.Callbacks.firejquery-1.7.1.js:1046
jQuery.Callbacks.self.fireWithjquery-1.7.1.js:1164
jQuery.extend.readyjquery-1.7.1.js:435
DOMContentLoadedjquery-1.7.1.js:923

@adaptabi

This comment has been minimized.

Show comment
Hide comment
@adaptabi

adaptabi Jan 23, 2012

Contributor

The error is still there!!
http://code.jquery.com/mobile/latest/demos/docs/lists/lists-nested.html#&ui-page=0-4

Even your first url crashes! http://jquerymobile.com/demos/1.0rc1/docs/pages/page-dialogs.html#&ui-state=dialog

Anyone, please reopen the issue! This is a serious bug, if the user refreshes the page nothing will be displayed!

Contributor

adaptabi commented Jan 23, 2012

The error is still there!!
http://code.jquery.com/mobile/latest/demos/docs/lists/lists-nested.html#&ui-page=0-4

Even your first url crashes! http://jquerymobile.com/demos/1.0rc1/docs/pages/page-dialogs.html#&ui-state=dialog

Anyone, please reopen the issue! This is a serious bug, if the user refreshes the page nothing will be displayed!

@adaptabi

This comment has been minimized.

Show comment
Hide comment
@adaptabi

adaptabi Jan 24, 2012

Contributor

Still error!

http://www.dotnetwise.com/tryAndError/jquery.mobile/select.filter/

Check out, even the hash is getting broken at all, as it will append & after the url itself, which will make the server link really unusable!

When you opent he first list you get to: http://www.dotnetwise.com/tryAndError/jquery.mobile/select.filter/#&ui-page=0-0
(which fails)

and then when you click on any of 3/4/5 selects you get to: http://www.dotnetwise.com/tryAndError/jquery.mobile/select.filter/&ui-page=0-0#&ui-state=dialog
(which fails even worse) - notice the &ui-page=0 is before the hash# - crazy bug!

Contributor

adaptabi commented Jan 24, 2012

Still error!

http://www.dotnetwise.com/tryAndError/jquery.mobile/select.filter/

Check out, even the hash is getting broken at all, as it will append & after the url itself, which will make the server link really unusable!

When you opent he first list you get to: http://www.dotnetwise.com/tryAndError/jquery.mobile/select.filter/#&ui-page=0-0
(which fails)

and then when you click on any of 3/4/5 selects you get to: http://www.dotnetwise.com/tryAndError/jquery.mobile/select.filter/&ui-page=0-0#&ui-state=dialog
(which fails even worse) - notice the &ui-page=0 is before the hash# - crazy bug!

@marcusg

This comment has been minimized.

Show comment
Hide comment
@marcusg

marcusg Mar 13, 2012

still an error in jqm 1.1.0rc1, any ideas?

marcusg commented Mar 13, 2012

still an error in jqm 1.1.0rc1, any ideas?

@snig-b

This comment has been minimized.

Show comment
Hide comment
@snig-b

snig-b Jun 20, 2014

Error in jquery 1.10.2 as well

snig-b commented Jun 20, 2014

Error in jquery 1.10.2 as well

@arschmitz

This comment has been minimized.

Show comment
Hide comment
@arschmitz

arschmitz Jun 20, 2014

Member

this was fixed long ago and different versions of jquery make no difference this was an issue with jQuery core upgrade your version of jquery mobile to fix this issue http://jsbin.com/ofuhaw/1#&ui-state=dialog

Member

arschmitz commented Jun 20, 2014

this was fixed long ago and different versions of jquery make no difference this was an issue with jQuery core upgrade your version of jquery mobile to fix this issue http://jsbin.com/ofuhaw/1#&ui-state=dialog

@snig-b

This comment has been minimized.

Show comment
Hide comment
@snig-b

snig-b Jun 27, 2014

Yeah Fixed
The bug arose because the hash expression was being used as a jquery selector
And use of '&' and '=' in Jquery selector was causing a problem.
Prevented this hash to be used as a selector and everything works fine now.

snig-b commented Jun 27, 2014

Yeah Fixed
The bug arose because the hash expression was being used as a jquery selector
And use of '&' and '=' in Jquery selector was causing a problem.
Prevented this hash to be used as a selector and everything works fine now.

@ayasha88

This comment has been minimized.

Show comment
Hide comment
@ayasha88

ayasha88 Jun 19, 2015

How did you solve?

How did you solve?

@sudarikovvadim

This comment has been minimized.

Show comment
Hide comment
@sudarikovvadim

sudarikovvadim Aug 17, 2015

I have such problem in jquery 1.8.2 version. I read answers above, but I do not find right solution.

I have such problem in jquery 1.8.2 version. I read answers above, but I do not find right solution.

@ayasha88

This comment has been minimized.

Show comment
Hide comment
@ayasha88

ayasha88 Aug 25, 2015

I solved by updating jquery and jquery mobile...

I solved by updating jquery and jquery mobile...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment