Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • jQuery getJson

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 457
    Comment on it

    getJson is the method that is used to call the json data by ajax call.

    We can only pass the parameter using the get method.

    ex of json call function and the data displayed.

    var jsonUrl = "Json.htm";
     $("#btnJson").click(function () {
     $("#dvJson").html(ajax_load);
     $.getJSON(jsonUrl, function (json) {
     var result = json.name;
     $("#dvJson").html(result);
     }
     );
     return false;
     });
    The json data returned by the Json.htm follow
    
    { "name": "Hemang Vyas", "age" : "32", "sex": "Male" }

    Important

    It send data only by get no post is allowed.

    It treat the response data as json only.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: