JQuery Mobile exception when adding dialog

JQuery Mobile exception when adding dialog

Hi (I may not be doing this correctly) - I am trying to and having problems navigating to a page in my JQuery Mobile (JQM) application when trying to load the page as a dialog using "changePage()". I have looked around and have tried a few alternatives with no luck :(

E.g. I have a login page that opens successfully as a dialog on the application init:

  1. $.mobile.changePage(page, {transition: 'pop', role: 'dialog' }); 

the login screen has a login button, which when clocked forwards to a normal (non dialog) page, again successfully and again using changePage:

  1. $.mobile.changePage( page );

The problem occurs when I again try to load the login page in the dialog (e.g. when logging out). I have a logout button, which when clicked navigates back to the login page:

  1. $.mobile.changePage(page, {transition: 'pop', role: 'dialog' }); 

However this time I get the following exception in the JQM lib: "Uncaught TypeError: Cannot call method 'indexOf' of undefined".

Thanks, Jon.