Search code examples
mysqljsonphonegap-desktop-app

Phonegap json '\r\n' coming data from server


I am developing an app using phonegap whereI am taking some data from MySql table using php code.. but when I display the reslting text .. there is '\n\r' in the text ... how to remove this and display the result... I am giving my javascript code below

var jsonData;
$.ajax({ 
    type: 'GET', 
    url: 'http://mybirthsecrets.com/app/get_pday1_number_phonegap.php', 
    data: {pone: dayb}, 
    dataType: 'html',
    success: function (result) { 
    jsonData = result;
        alert(jsonData);

    }
});

Solution

  • @Jocheved it is very easy ..

     jsonData = result;
    

    Instead of this line give the following line

     jsonData=eval('(' + result + ')');