Skip to content


Subversion checkout URL

You can clone with
Download ZIP


active.url is undefined #4202

mletynski opened this Issue · 13 comments

10 participants


After update to latest jqm build im getting an error while trying to display dialog.

"active.url is undefined"

3596: "if ( active.url.indexOf( dialogHashKey ) > -1 && !$ ".ui-dialog" ) ) {"



I can't reproduce this issue on - can you post a jsbin or jsfiddle ( example so we can reproduce it?



Sorry for delay. Here is the code:

We are generating pages/dialogs dynamically via backbone and injecting them into body. I attached you a code without backbone just simple injecting page. The bug still exists.

How to reproduce it:
1) click into "Replace page with page" link
2) click into "Replace page with dialog" link

It is working with 1.1.0 version.



I have to take a closer look at this but I believe the timing and data url values are the issue in your example. One thing you might consider having a look at (if you haven't already) is this post

Which covers the pitfalls of integrating the backbone router with jqm. Post back if that doesn't help you out.


Yeah i know this article very well and i had to disable JQM routing to work with backbone router.


Any progress for this issue ? I just don't want to patch jquery again i have already it patched with this all flickering issues.

@johnbender johnbender was assigned

I just ran into this as well. We are using no routing(app is wrapped in phonegap and navigation is internal to the app with dynamically generated content), so the url for our active page is undefined when we attempt to open a dialog.

I am seeing this in the 1.1.1 release on line 3396


I'm also working with JQM and Backbone. Try the following;

    var $view = $(view.el);
    $view.attr('data-url', window.location.pathname + window.location.hash);

Apologies, but this code is required prior to every $.mobile.changePage call in the router. Here is the full function that I use;

changePage: function (view) {
    // Generate view

    // Add new page
    var $view = $(view.el);
    $view.attr('data-url', window.location.pathname + window.location.hash);

    // Switch to new page
    $.mobile.changePage($view, { changeHash: false, reverse: $.data(window, 'reverse') });

    // Reset defaults
    $.mobile.defaultPageTransition = 'slide';
    $.data(window, 'reverse', false);

I use $.data(window, 'reverse') to control the direction of the transition, handy for back and home buttons.


Related PR: #4928


Also had the same issue when I switched to 1.1.1, moved back to 1.0.1 and dialogs are now working fine. I have a changePage function that works fine in 1.1.1, but the showDialog function receives the "active.url is undefined".


I had the same problem, but as custom select menu also uses dialog when the list is too long, now the list shows and I can click the list items, but it doesn't change the selected item.


annoying bug, can you please merge the patch?


+1 please merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.