I am trying to use JQuery Ajax to call WCF, but it seems it doesn't
recoginze the path. Here is my code:

  $.ajax({ type: "GET",
            url: "http://localhost:3314/WCFServiceEx/Service.svc/
GetData",
                contentType: "application/json; charset=utf-8",
                dataType: "jsonp",
                // data: '{"PatientID":"' + PatientID + '","PageName":
"Desktop","WidgetOrder1":"' + hdnCol1.value + '","WidgetOrder2":"' +
hdnCol2.value + '","WidgetOrder3":"' + hdnCol3.value +
'","WidgetOrder4":"' + hdnCol4.value + '","WidgetOrder5":"' +
hdnCol5.value + '","WidgetOrder6":"' + hdnCol6.value + '" }',
                success: function(data) {
                    alert(data.d);
                },
                error: function(xhr) {
                    if (xhr.responseText) {
                        alert("text");
                        $("body").html(xhr.responseText);
                    }
                    else
                        alert('unknown error');
                    return;
                },
                cache: false
            });
        }

Any suggestion?

Thanks,
NH

Reply via email to