1. #1
    Sencha User
    Join Date
    Aug 2011
    Posts
    7
    Vote Rating
    0
    alexanderHs is on a distinguished road

      0  

    Default Unanswered: How to ger Url parameters with Sencha Touch

    Unanswered: How to ger Url parameters with Sencha Touch


    How can get a parameter from the url, i mean if have
    page1.html#token=12345
    i need to get the token from the url, in sencha how it is?

  2. #2
    Sencha User
    Join Date
    Aug 2010
    Posts
    303
    Answers
    3
    Vote Rating
    3
    steve1964 is on a distinguished road

      0  

    Default


    Hi, this is not related with Sencha Touch, i use this javascript function to retrieve url parameter:

    Code:
           function gup( name ){
            name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
            var regexS = "[\\?&]"+name+"=([^&#]*)";
            var regex = new RegExp( regexS );
            var results = regex.exec( window.location.href );
            if( results == null )
             return "";
            else
            return results[1];
           }
    
    
           var urlparam = gup('yourParam')
    ;

  3. #3
    Sencha User interfasys's Avatar
    Join Date
    Mar 2011
    Location
    UK & Switzerland
    Posts
    125
    Vote Rating
    1
    interfasys is on a distinguished road

      0  

    Default


    Ext.urlDecode("foo=1&bar=2"); // returns {foo: "1", bar: "2"}
    Olivier - interfaSys
    Developing custom solutions for BlackBerry 10 using Sencha Touch.

Thread Participants: 2

Tags for this Thread