I have written a function in javascript
function abc()
{
var Url = "MyService.svc/MyMethod";
var Param = '{"Keyword":"' + Keyword + '","Type":"' + type + '"}';
$.ajax({
type: "POST",
url: Url,
data: Param,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
var pdResults = msg.MyServiceResult;
},
error: function (xhr, ajaxOptions, thrownError) {
}
});
}
//---------------------------------------------------
on the server side I have written method
public string MyMethod(string Keyword, string Type)
{
return "1";
}
//--------------------------------------------------- Problem :
Problem is Javascript method never goes into success method. in error method it shows
parse error: Unexpected token <
I don't know what part is causing this problem. I couldn't find a solution, can somebody fix it.