1. #1
    Sencha Premium Member
    Join Date
    Mar 2012
    Posts
    13
    Vote Rating
    0
    surajan is on a distinguished road

      0  

    Default Error decoding response: SyntaxError: syntax error

    Error decoding response: SyntaxError: syntax error


    I am doing the following stuff when a form is submitted. But I get this error:
    Error decoding response: SyntaxError: syntax error
    Here is my onSubmit success function:


    onSubmit: function() { var vals = this.form.getValues(); Ext.Ajax.request({ url: 'ticketSession.php', jsonData: { "function": "sessionTicket", "parameters": { "ticket": vals['ticket'] } }, success: function( result, request ) { var obj = Ext.decode( result.responseText ); if( obj.success ) { //alert ('got here'); th.ticketWindow.hide(); Web.Dashboard.loadDefault(); } },
    Here is my ticketSession.php


    <?phpfunction sessionTicket($ticket) { if( $_REQUEST['ticket'] ) { session_start(); $ticket = $_REQUEST['ticket']; $_SESSION['ticket'] = $ticket; echo("{'success':'true'}"); } echo "{'failure':'true', 'Error':'No ticket Number found'}");}?>

  2. #2
    Sencha Premium Member
    Join Date
    Mar 2012
    Posts
    13
    Vote Rating
    0
    surajan is on a distinguished road

      0  

    Default


    i wonder why it wont let me format my source code on this forum

  3. #3
    Sencha Premium Member danguba's Avatar
    Join Date
    Feb 2009
    Location
    Kragujevac, Serbia
    Posts
    370
    Vote Rating
    5
    danguba is on a distinguished road

      0  

    Default


    To format code wrap it with [PHP] or [CODE] tags.

    Try to console.log result before you do decoding to see what exactly are you receiving from server
    All Best
    ---
    Željko Mitrović
    http://skitanja.blogspot.com/

    "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." Martin Golding

Thread Participants: 1

Tags for this Thread