Click here to Skip to main content
13,087,797 members (80,191 online)
Rate this:
Please Sign up or sign in to vote.
See more: , +
This is the WCF Service code:

        [WebGet(RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
        public String GreetJson()
            Greeting g = new Greeting();
            g.Message = "Hello World!";
            Console.WriteLine("call received");
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            return serializer.Serialize(g); ;

and the client request:
                alert("test=" + data);
<img src="data/images/menu/highscore.png" alt="Highscore" id="test" />

if we use in a browser we get:
"{\"Message\":\"Hello World!\"}"

Our problem is that we don't receive any response from the server when we do getJSON request.

Console.WriteLine("call received"); //the message appears in the console but on the browser there is no alert box.
Any idea why?
Posted 8-Apr-12 4:15am

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.170813.1 | Last Updated 8 Apr 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100