facebook

Function sample()

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

    Nie Que
    Member

    Hi, Im using mobiOne for my application. I have this function and it work well when i put it ON THE PAGE CHANGE. so i put it on my sample_custom.js and the activepage() function ON THE PAGE CHANGE but it wont work anymore. \\

    Is there somebody who could help me with this. any reply would be appreciated. thank you

    function activepage()
    {
    var activePage = $(newPage).attr(‘id’);

    if (activePage == ‘m1-TacticalAsia-Cart’) {
    alert(activePage);
    }else if(activePage == ‘m1-TacticalAsia-Home’) {

    alert(activePage);//some other code
    changeImage();
    }
    else
    {
    alert(‘do nothing’);
    }
    }

    #350584 Reply

    Brandon
    Member

    The newPage variable is most likely not getting set (not sure where you are setting this), remember any var inside a function is scoped only to that function and will not be available globally.

    Example:

    var myVar = 3;\\Available globally

    function myCall()
    {
    var myVar1 = 3; \\available only in myCall
    }

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Function sample()

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