javascript - refreshing specific div using AJAX -


I'm totally new to AJAX, so I'm sorry if the question is too stupid or anything. / P>

OK, so goes here ...


Assume that the file has the following content:

 < Code> & lt; Html & gt; & Lt; HEAD & gt; & Lt; Title & gt; Ajax Test & lt; / Title & gt; & Lt; / HEAD> & Lt; Body & gt; & Lt ;! - No need to replace other materials - & gt; & Lt; One class = "vomiting" href = "#" & gt; Button & lt; / A & gt; & Lt; Div class = "rainbow" & gt; & Lt ;? Php echo mt_rand (0,100); ? & Gt; & Lt; / Div & gt; & Lt ;! - No need to replace other materials - & gt; & Lt; / Body & gt; & Lt; / Html & gt;   

I want to create it so that whenever clicked a.puke , content of div.rainbow will be refreshed.

How do I get such a result?

Thank you.

Since you are new to AJX, here is an example of code for AJAX and PHP. View this link

  $ .ajax ({url: "http://example.com/index.php", type: "GET", cache: incorrect, success: function ( Data) {$ ("Div.rainbow") .html (data);}});    

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -