Hi , Please tell me how to call the ajax request and add a response into DIV. This is what i tried: $.ajax({ type: "POST", url: "test.php", data: "username=vetri", success: function(msg){ $("#loggedin").html(msg); } }); And also in the php file i have added a few redirection and when i call the ajax without using jquery it didnt redirect but when using jquery it is making a extra ajax request for that redirect url.(i have found this in the firebug). How to solve this. I dont like to redirect that url only when i made a ajax call. Please guide me.
Hi, vetrivel If you want just to make ajax request and load response into div you can use this function: jQuery.post(url, [data], [callback], [type]) Code (markup): Example: jQuery.post("test.php", { username: "vetri" }, function(data) { $("#loggedin").html(data); }, "html"); Code (markup): But if there are redirects in your test.php, I think that it will not work.
I need to handle the error and success handle,because the when this request succeed than i need to call another request. chain process. But it worked in the simple ajax call(without using any plugins).