facebook

Need ‘a’ button to execute JS and goto a page new page

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #323432 Reply

    rbarth
    Member

    I looked at the phoneui code and made some headway understanding what’s happening in there, but I can’t put my finger on the function(s) to start the ‘go to new screen’ process.
    I need to set a few javascript variables before I go to a new screen. Your IDE allows me to either run javascript or go to a new screen. I thought if I define the button to run javascript, I could set my variables and then pass control to the function(s) to go to a new screen. Can you tell me what function I should call to ‘go to a new screen’? In case it matters, I need to submit a form as an AJAX call for DATA that will fill the new screen.

    #323476 Reply

    support-michael
    Keymaster

    @rbarth

    Here is the javascript function to call from either a Run JavaScript action or from your own javascript function:

    phoneui.gotoPage(pageId,transitionEffect)

    The transitionEffects are ‘NONE’, ‘FADE’, ‘FLIP_RIGHT’, ‘FLIP_LEFT’, ‘SLIDE_RIGHT’, ‘SLIDE_LEFT’, ‘SLIDE_UP’, ‘SLIDE_DOWN’

    I always crack open the code and look up the page ids.

    See attachment page2-code.png

    
    //Example function calls
       phoneui.gotoPage('m1-page2')  //uses default slide-left transition
       phoneui.gotoPage('m1-page2,'FADE')   // use fade transition effect
       phoneui.gotoPage('m1-page2, phoneui.transitions.fade)   // use fade transition effect
    
    Attachments:
    You must be logged in to view attached files.
Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Need ‘a’ button to execute JS and goto a page new page

You must be logged in to post in the forum log in