Implementing JQuery

Implementing JQuery

Implementing JQuery is little bit similar with Implementing AJAX. However Implementing JQuery could be more vary. It because JQuery has its own defined function.

However, in this Implementing JQuery post, ill only explain simple way to communicate with server with JQuery without reload.

Frist you need to download the JQuery file. You can download it from http://jquery.com/. Then lets us jump to the code.

<script language="javascript" src="jquery.js"></script>
<script language="javascript">
function jquery(){
	$.post("test.php",{ call:'server' } , function(data){
		document.getElementById("return").innerHTML=data;
	});
}
</script>

<button type="button" onclick="jquery()">Call Server</button>
<div id="return"></div>

The second code will be the code for the file that called by JQuery.

if(isset($_POST['call'])&&$_POST['call'] == 'server')echo 'Server say hello to you';

Totally, you will need 3 files. However, you can make the HTML file to call itself so it will only need 2 files.

That’s all about Implementing JQuery that i can share today. Hope this Implementing JQuery can be useful for you.

http://septiadi.com/2011/04/20/implementing-jquery/

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

%d bloggers like this: