Posted by: prajapatinilesh | May 14, 2012

jquery ajax call

// Include jquery library. <script src=”jquery file path”>

<div id=”facebook_feed_display_div” style=”height:300px;width:420px;overflow:auto;”></div>

<script>
function callFacebookFile() {
$(“#facebook_feed_display_div”).html(‘<span style=”color:red;font-size:13pt”>Loading Please Wait….!</span>’);

var urlFacebookCall = ‘facebook_call.php’;

var parameterString = ‘facebookAccountId=<?=$facebookAccountId?>’;
parameterString += ‘&param2=<?=$param2?>’;

$.ajax({
url:”facebook_call.php?facebookAccountId=<?=$facebookAccountId?>&param2=<?=$param2?>”,

//url: urlFacebookCall,
//data: parameterString,

success:function(result) {
$(“#facebook_feed_display_div”).html(result);
},
error: function (xhr, status, error) {
//alert(xhr.status);
//alert(xhr.responseText);
//alert(error);
}
});
}//End of function callFacebookFile

callFacebookFile();
</script>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: