Blog > detail

Just my tiny mind

Implementing JQuery

26-2-2012 Admin General 2 Comments

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 type="text/javascript" language="javascript" src="jquery.js"></script><script type="text/javascript" language="javascript">// <![CDATA[

function jquery(){

$.post("test.php",{ call:'server' } , function(data){

document.getElementById("return").innerHTML=data;

});

}

// ]]></script>


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


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.

 Implementing JQuery

Implementing JQuery

word word

Implementing JQuery

Implementing JQuery

Implementing JQuery