SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Here is My code ..could anyone please solve this problem..I was struggling from morning..below code is not working.Actually i should get the data when we send jasondata as input..but i am getting error.

    <html xmlns="">
    <head runat="server">
<script src="Scripts/jquery-1.7.min.js" type="text/javascript"></script>
<script type="text/javascript">
    function myQuerySuggestions() {
        var searchText = document.getElementById('txtsearch').value;
                    searchText = "'" + searchText + "'";
                    var jasonData = "{" + 'CountryName:' + searchText + "}";
            url: "",
            dataType: "jsonp",
            crossDomain: true,
            jsonpCallback: 'blah',
            contentType: "application/json; charset=utf-8",
            success: function (data, status) {
                alert(status+" status");
            error: function () { alert("error"); } 

    function blah(data) {
        var result = (typeof data.d) == 'string' ? eval('(' + data.d + ')') : data.d;
        $('#summary').html('<p>All new content. <em>You bet!</em></p>');

<form id="form1" runat="server">
    <label for="txtsearch">
        Enter country:
    <input type="text" id="txtsearch" size="43" style="font-size: 12px; font-weight: bold;" />
    <br />
    <asp:Button ID="btn" runat="server" Text="Submit" OnClientClick="myQuerySuggestions();return false;" />
    <div id="summary" runat="server"></div>
share|improve this question

My First question, when I saw your code above, was: Does the service support returning json data and recognizes jsonp format? I could not find any evidence that json is supported as a response data structure...

If you have gotten information from this service provider that the API does in fact support jsonp, can you post the expected format?

Also, It would be good to for you to also post the Error you are getting (in detail, if possible)... It will helps us to help you. :)


share|improve this answer
actual output will be in xml format.. – Revanth kumar Jan 10 '13 at 5:17
errors are parse error and jquery123123132131 not defined – Revanth kumar Jan 10 '13 at 5:37
Sounds like, then, the webservice you are trying to use does not support jsonp, so you can't do what you are attempting. – Paul T. Jan 11 '13 at 3:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.