Hi,

I'm posting here because I think the issue is related to my
webservice, not to the javascript code.

Here's what my webservice looks like :

[WebService(Namespace = "http://tempuri.org/";)]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET
AJAX, uncomment the following line.
[System.Web.Script.Services.ScriptService]
public class Publication : System.Web.Services.WebService {

    [WebMethod]
    public string GetPublication() {
      String result = "";

      result = @"{""weatherObservation"":{  ""clouds"":""few
clouds"" }}";

      return result;
    }
}

and upon successful return from my webservice, I do the following in
my javascript code:

var data = eval('('+ result +')');

where result holds my string data returned by the webservice.

I get the following error : Microsoft JScript compilation error:
Expected ']'

If I hardcode the string in my javascript and use the same eval
statement, it works like a charm. So I believe something needs to be
changed in the webservice (some configuration maybe ??) ....

Any idea ?

Thanks

Reply via email to