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 I want to create it so that whenever clicked 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 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;
a.puke , content of
div.rainbow will be refreshed.
$ .ajax ({url: "http://example.com/index.php", type: "GET", cache: incorrect, success: function ( Data) {$ ("Div.rainbow") .html (data);}});
Comments
Post a Comment