Last updated on May 11th, 2016 at 03:16 pm

Ajax Jquery example

This is a simple script which uses JQUERY to easily collect data from another webpage using asynchronous data collection method [AJAX].
Here the page loads another content without reloading the entire webpage. It loads data in to a div tag using AJAX.
Here is the script, rssreader.php is the PHP page I am calling to display the content. You should have your own web page to be called during the setup.

<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
  $("#data_call_display").ajaxStart(function(){
    $("#data_loading").css("display","block");
  });
  $("#data_call_display").ajaxComplete(function(){
    $("#data_loading").css("display","none");
  });
  $("[href='#']").click(function(){
    $("#data_call_display").load("rssreader.php");
  });
});
</script>
</head>
<body>
<a href="#">Get The Content</a>
<div id="data_call_display"><h2>Ajax Content Loads Here</h2></div>
<div id="data_loading" style="display:none;width:69px;height:89px;border:0px solid black;position:absolute;top:50%;left:45%;padding:2px;"><br /><img src="loading.gif"/></div>
</body>
</html>

DEMO

2 thoughts on “Ajax Jquery example”
  1. hi want to do zoomin zoomout when mouse over image control in ajax how to do this Or in odinary coding c#

Leave a Reply

Your email address will not be published. Required fields are marked *