Page 1 of 2
Page Refresh & Linking in Custom Javascript
Posted: Tue May 15, 2012 10:10 pm
by Chris2656882
How do you refresh a page and navigate to another screen using custom JavaScript?
I used the following notations, and neither worked:
Code: Select all
location.reload(true);
$.mobile.changePage( "start_page.html", { transition: "fade"} );
Page Refresh & Linking in Custom Javascript
Posted: Tue May 15, 2012 10:29 pm
by maxkatz
This worked for me:
code
$.mobile.changePage( "page2.html", { transition: "fade"} );
/code
My page from which I'm navigating is called 'page1'.
Page Refresh & Linking in Custom Javascript
Posted: Tue Jun 05, 2012 1:01 am
by Chris2656882
It should be noted to people that the page URLs are in the format "mob-(page name).html"
That is, the name of the page in the project has "mob-" prepended to it.
Page Refresh & Linking in Custom Javascript
Posted: Tue Jun 05, 2012 1:03 am
by maxkatz
Just the page name (without mob-) should work. mob- is added when viewing in desktop browser. We are getting rid of that as well, soon.
Page Refresh & Linking in Custom Javascript
Posted: Tue Jun 05, 2012 11:40 am
by Chris2656882
Without adding "mob-" the page transitions do not work for me in Chrome!
Page Refresh & Linking in Custom Javascript
Posted: Tue Jun 05, 2012 4:34 pm
by maxkatz
I just tried code from the original reply and it worked.
Page Refresh & Linking in Custom Javascript
Posted: Sat Jun 23, 2012 3:33 pm
by Chris2656882
I had been using the JQuery page transitions and they were working just fine. For example:
$.mobile.changePage( "property_profile.html" );
But recently, this is no longer working. Though, if it pre-pended with "mob-"
$.mobile.changePage( "mob-property_profile.html" );
it will work. But you had said this is only for desktop viewing.
Did you change the page name structure recently?
Page Refresh & Linking in Custom Javascript
Posted: Sat Jun 23, 2012 7:53 pm
by maxkatz
I tried $.mobile.changePage( "mobilescreen2.html" ) and it worked. In general, you want to use the Tiggzi Navigate To Page, as when you navigating, we determine what resources need to be loaded in the new page.
Page Refresh & Linking in Custom Javascript
Posted: Sat Jun 30, 2012 5:22 pm
by Chris2656882
I write most of the code in Javascript, so the Tiggzi Navigate To Page is not an option.
All the $.mobile.changePage links that I had written that previously worked no longer do for some odd reason.
Page Refresh & Linking in Custom Javascript
Posted: Sun Jul 01, 2012 4:06 am
by maxkatz
Check if there are any JavaScript errors in console...