SoFunction
Updated on 2025-04-10

jquery allows the returned content to be displayed in a specific div (the code is small and the code is exquisite)

Written beforeajax lets the returned content be displayed in a specific divI'm reading jquery recently, so I rewritten it with jquery again. jquery is indeed "written less and done more"

<html> 
<head> 
<title></title> 
<script type="text/javascript" src="/jquery-2.1."></script> 
<meta charset="utf-8" /> 
<script> 
$(function(){ 
$("#right").load(""); 
$("#left").click(function(){ 
$("#right").load(""); 
return false;//Prohibit button submission}); 
}); 

</script> 
</head> 

<body> 
&lt;div &gt;&lt;a href="#">Click here</a></div>&lt;hr /&gt; 
&lt;div &gt;&lt;/div&gt; 
&lt;/body&gt; 
&lt;/html&gt;