Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doesn't really work jqm1.2.0 rtm #63

Open
dotnetwise opened this issue Oct 20, 2012 · 9 comments
Open

doesn't really work jqm1.2.0 rtm #63

dotnetwise opened this issue Oct 20, 2012 · 9 comments

Comments

@dotnetwise
Copy link

Unfortunately it doesn't work to jqm 1.2.0
Update your examples to use it and you'll see what I'm talking about!

@ghost
Copy link

ghost commented Oct 21, 2012

I have a quite large project and upgraded to jQM 1.2.0 and there are no problems with the router, except issue#61, which was related to the new popup widget.

However, Andrea fixed it immediately.

If you have some issues I suggest being more specific!

@azicchetti
Copy link
Owner

Hi @dotnetwise,
as bardu said I can't be of much help until I see your code.

Basic test cases with 1.2.0 seem to work as expected (ajax and local pages with standard page events), although I'm sure that under obscure circumstances certain things may fail.

@cdiaz-concur
Copy link

I am experiencing the same problem as dotnetwise.

To replicate, modify examples/test.html to use the new jQM 1.2.0 along with jQuery 1.8.2. Clear all browser cache and exit out of all browser tabs and windows - basically launch a fresh browser.

Instead of launching the test example normally, try going to localpage2 with parameters.

e.g. http://localhost/router/examples/test.html#localpage2?foo=bar

Notice the JS console will output "Index has been show" instead of the expected "localpage2: pagebeforecreate #localpage2?foo=bar".

Now, try launching the same localpage2 URL but without any parameters. You can see from the output in the JS console that the correct handler was triggered.

It seems the issue arrises when you are trying to launch a page with parameters (rather than from a link within the jQM app). This is a major road-block for my app since I'm launching into my jQM app from within my native Android app and it fails.

Any help would be greatly appreciated!

@cdiaz-concur
Copy link

It looks like this may be an issue with jQM 1.2.0 rather than router:

jquery-archive/jquery-mobile@207f854
jquery-archive/jquery-mobile#5121
jquery-archive/jquery-mobile#5085

@azicchetti
Copy link
Owner

Hi @cdiaz-concur,
your last message describes the problem very well, so that I can at least point you in the right direction.

This issue has already been reported and analyzed (#64), but unfortunately it cannot be fixed on my end, because it's due to a bug in jQuery Mobile.
Basically, the first event is not triggered by the framework and the router cannot add support for hash parameters.

I've reported this to the jQM guys and they fixed it in the latest trunk.
Starting from 1.2.1, we'll have native support for hash parameters and this is a very good news, since I can strip that part from the router and improve its stability.

There's still another bug in the current jQM trunk that compromises the bookmarkability of urls, I'm waiting for them to fix it (jquery-archive/jquery-mobile#5230) before rolling out the next version of the router.

To sum this up, you have to wait for 1.2.1 or use the legacy version in the meanwhile.

@cdiaz-concur
Copy link

Thanks for the quick response, azicchetti!

Good to hear this will be resolved in jQM 1.2.1. You and the jQM team are doing an awesome job! =)

@rmgdc
Copy link

rmgdc commented Nov 7, 2012

If it can help somebody i've found a combination that allows to use jQM 1.2.0 and the router.

Using pushStateEnabled = true (mandatory for back buttons to work) and altering the router "pagebeforechange" event to:

if (data.options.fromHashChange) {
var toPage=location.hash;
} else {
var toPage=( typeof data.toPage === "string" ) ? data.toPage : data.toPage.jqmData("url")||"";
}

will do the trick.

Regards.
Azicchetti, thanks for the good work.

@joelstein
Copy link

rmgdc, will you post an example of the code you got to work?

@rmgdc
Copy link

rmgdc commented Dec 19, 2012

I've posted above. The trick is to alter the pagebeforeshow binding on mobile router to what i've posted. The pushStateEnabled is not needed (I had problems on some mobile browsers with pushStateEnabled = true)

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

No branches or pull requests

5 participants