Yes, jquery tries to interpret it as JSON data, but that is XML and
not JSON, thus the 'parserror'.
XML that contains JSON in its "string" node.
You should set your datatype to xml, but even then I'm not sure if
that will work quite well.
In best case you can extract the value of xml string node
Well the reponseText property of the XHR object contains :
http://tempuri.org/";>{"results": [
{
"id": "4",
"value": "guardian.co.uk"
}
]}
that's what the webservice returns. Since dataType of my jquery ajax
method is set to 'json
So the AJAX call actually returns some result now?
If you alert() the result, before trying to do anything with it, what
do you get?
On Jan 30, 11:35 am, graphicsxp wrote:
> >This should only be set if your webservice expects the input parameter
> >in JSON format as well, and not only the resp
>This should only be set if your webservice expects the input parameter
>in JSON format as well, and not only the response is JSON.
>Is this the case?
Yes, I thought that too. I've removed the contentType parameter. In
this case the webservice is reached.
But when the AJAX call returns I get the
A parameter has to be key=>value, in some form, otherwise how is it
identified?
contentType: "application/json; charset=utf-8",
This should only be set if your webservice expects the input parameter
in JSON format as well, and not only the response is JSON.
Is this the case?
How does the code o
Thanks.. I tried that but I'm getting an error before the webservice
is reached : "Invalid JSON primitive: pText."
Like I said, my webservice's method expects a string, not a JSON key-
value pair. I'd be surprised if we can't pass a simple string to a
webservice ?
On 29 jan, 16:24, MorningZ w
Right from the docs
http://docs.jquery.com/Ajax/jQuery.ajax#options
"Object must be Key/Value pairs"
something that
data: "pText=some text"
is not (it's a string)
so with that pointed out, try
$.ajax({
url: "Publication.asmx/GetPublication",
data: { pText: "some text" },
7 matches
Mail list logo