Click here to Skip to main content
15,792,870 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
function GetData() {
    var url = "http://localhost:60191/SampleService.asmx/SayHello";
        type: 'GET',
        url: url,
        crossDomain: true,
        contentType: "application/json; charset=utf-8",
        //data: "{firstName:'Aidy', lastName:'F'}",
        dataType: "jsonp",
        timeout: 4000,
        async: false,
        success: function (data) {

            var aa = JSON.parse(data);
            $.each(msg, function (name, value) {
        error: function (xhr, status, error) { alert('error 404 !!'); },
        async: false,
        cache: false
Updated 17-Mar-15 21:00pm
Mohibur Rashid 18-Mar-15 3:16am    
alert the data before you parse with json parse. It seems your PHP(guessed it, without any valid reason) has an error. I can be wrong too.

1 solution

It could be caused by your JSON.parse.

You do not need it. If the server tells jQuery the awnser is application/json. Or you tell jQuery it is dataType: "jsonp",
jQuery will parse the data for you.

So now you are parsing a javascript object.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900