jQuery Ajax example

$(document).ready(function() {
	$("#link").click(function() {
		$("#output").load(
						"site.php",
						{ id: 4, name: "test" },
						function() {
							alert("I was clicked");
						}
		);
	});
});

Download this snippet

Loads page "site.php" with passed post variables "id" & "name" and posts the output to div "output", when DOM element with id "link" is clicked

Twitter Twitter

6 Comments to “ jQuery Ajax example”

  1. Anonymous  on Sep 04, 2009

    lh1GM8 <a href="http://ijzopzywbfcs.com/">ijzopzywbfcs</a>, [url=http://hvkoutzerxef.com/]hvkoutzerxef[/url], [link=http://dyrlcocmectc.com/]dyrlcocmectc[/link], http://nqdbchnlawcy.com/

  2. Anonymous  on Sep 25, 2009

    aX9pIc <a href="http://xxdkkcqduwio.com/">xxdkkcqduwio</a>, [url=http://icwqngrtoxon.com/]icwqngrtoxon[/url], [link=http://tjgrnewngarf.com/]tjgrnewngarf[/link], http://rcnwcbzprmku.com/

  3. Anonymous  on Nov 04, 2009

    vECo6e <a href="http://dyxibumwuxkg.com/">dyxibumwuxkg</a>, [url=http://wtyihkkqyfuw.com/]wtyihkkqyfuw[/url], [link=http://bblvthtswliy.com/]bblvthtswliy[/link], http://zaxroinkktkn.com/

  4. Anonymous  on Jan 13, 2010

    UQvJ54 <a href="http://qviphvcabihy.com/">qviphvcabihy</a>, [url=http://uuaoprffsrzg.com/]uuaoprffsrzg[/url], [link=http://svfqcpvpdgif.com/]svfqcpvpdgif[/link], http://zjkvubzzrpof.com/

  5. Anonymous  on Jan 22, 2010

    PaoLlv <a href="http://uqwulolkgxvj.com/">uqwulolkgxvj</a>, [url=http://uudpwnihvfmf.com/]uudpwnihvfmf[/url], [link=http://hwqcmubquoei.com/]hwqcmubquoei[/link], http://fmnuvcqzdprm.com/

  6. Anonymous  on Mar 14, 2010

    q3KK3i <a href="http://arzlumkccejy.com/">arzlumkccejy</a>, [url=http://zmuhdnumhbcr.com/]zmuhdnumhbcr[/url], [link=http://aweqrievpdvu.com/]aweqrievpdvu[/link], http://zdperhbsqgga.com/

Leave a Comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>