1. #1
    Sencha User
    Join Date
    Feb 2013
    Location
    Sweden
    Posts
    13
    Vote Rating
    0
    Intraday is on a distinguished road

      0  

    Default Answered: Ext.Ajax.requst

    Answered: Ext.Ajax.requst


    Hello,

    From my Ext Js controller I have this function:
    Code:
            Ext.Ajax.request({
                url: 'save.php',
                method: 'POST',
                params: {
                    mode: 'Submit'
                },
                jsonData: '[{text1:test,text2:go,text3:ready}]',
                success: function() {
                    console.log('success');
                },
                failure: function() {
                    console.log('Failure');
                }
            });
    Can you please tell me how to handle the json in the save.php page?
    I want to decoded the json to an array in the php-page.

    Thanks in advance

  2. Hi,

    You need to put the jsondata inside the params like this:

    Code:
            Ext.Ajax.request({
                url: 'save.php',
                method: 'POST',
                params: {
                    mode: 'Submit',
                    jsonData: '[{text1:test,text2:go,text3:ready}]'
                 },
                success: function() {
                    console.log('success');
                },
                failure: function() {
                    console.log('Failure');
                }
            });
    And then in the PHP script try to get $_POST['jsondata']

    Quote Originally Posted by Intraday View Post
    Hello,

    From my Ext Js controller I have this function:
    Code:
            Ext.Ajax.request({
                url: 'save.php',
                method: 'POST',
                params: {
                    mode: 'Submit',
                },
                jsonData: '[{text1:test,text2:go,text3:ready}]', 
                success: function() {
                    console.log('success');
                },
                failure: function() {
                    console.log('Failure');
                }
            });
    Can you please tell me how to handle the json in the save.php page?
    I want to decoded the json to an array in the php-page.

    Thanks in advance

  3. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    Sweden
    Posts
    13
    Vote Rating
    0
    Intraday is on a distinguished road

      0  

    Default


    Please help me. Anyone?

  4. #3
    Sencha User
    Join Date
    Dec 2007
    Posts
    115
    Answers
    1
    Vote Rating
    12
    corvonero will become famous soon enough

      1  

    Default


    Well, first of all, jsonData is deprecated, so I think you shall not use it.

    Second, the "params" parameter is where you set the parameters you want to send to the server.

    In PHP, you will find them as $_POST['mode'] = "Submit"

  5. #4
    Sencha User
    Join Date
    Mar 2013
    Posts
    3
    Answers
    1
    Vote Rating
    1
    gaquaytomsk is on a distinguished road

      1  

    Default


    Hi,

    You need to put the jsondata inside the params like this:

    Code:
            Ext.Ajax.request({
                url: 'save.php',
                method: 'POST',
                params: {
                    mode: 'Submit',
                    jsonData: '[{text1:test,text2:go,text3:ready}]'
                 },
                success: function() {
                    console.log('success');
                },
                failure: function() {
                    console.log('Failure');
                }
            });
    And then in the PHP script try to get $_POST['jsondata']

    Quote Originally Posted by Intraday View Post
    Hello,

    From my Ext Js controller I have this function:
    Code:
            Ext.Ajax.request({
                url: 'save.php',
                method: 'POST',
                params: {
                    mode: 'Submit',
                },
                jsonData: '[{text1:test,text2:go,text3:ready}]', 
                success: function() {
                    console.log('success');
                },
                failure: function() {
                    console.log('Failure');
                }
            });
    Can you please tell me how to handle the json in the save.php page?
    I want to decoded the json to an array in the php-page.

    Thanks in advance

  6. #5
    Sencha User
    Join Date
    Feb 2013
    Location
    Sweden
    Posts
    13
    Vote Rating
    0
    Intraday is on a distinguished road

      0  

    Default


    Thanks alot!

Thread Participants: 2

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."