Skip to content Skip to sidebar Skip to footer

Html5 Request Response Webservice

I am pretty new to html5 web development I have created a page with login and password on it and have a submit button. On submit , I send a rest request to the server which has a u

Solution 1:

First of all see basic jQuery example. This will guide you through how jQuery works and help a lot in the solution I'm going to suggest.

http://learn.jquery.com/about-jquery/how-jquery-works/

jQuery has it's own AJAX method and further shorthand called $.post

Now you can write something like this -

functionrequestNetwork() {
    // Code for loading screen
    $.ajax({
        url: "yourURL",
        data: "yourData"
    }).done(function(data) {
        alert(xmlHttp.responseText);
        // Code for dismissing loading screen
    }).fail(function(data) {
        // Code when call fails
    }).always(function() {
        // This code will always run
    });
}

Post a Comment for "Html5 Request Response Webservice"