Javascript 在一个div中加载不同的php页面
如何在单个div块上加载php页面? 我在index.php上有一个示例Javascript 在一个div中加载不同的php页面,javascript,html,Javascript,Html,如何在单个div块上加载php页面? 我在index.php上有一个示例 <a>when i click this link it loads the home.php page on the div</a> <a>when i click this link it loads the location.php page on the div</a> <div id="content"> </div> 当我单击此链接时,它
<a>when i click this link it loads the home.php page on the div</a>
<a>when i click this link it loads the location.php page on the div</a>
<div id="content">
</div>
当我单击此链接时,它将加载div上的home.php页面
当我单击此链接时,它将加载div上的location.php页面
使用jQuery,您可以使用.load和.html函数将各个页面加载到content div您可以使用jQuery方法:
可以使用用作“页面内容div”的iFrame
如果要使用AJAX,请查看jQuery和
.load()
函数。
$('#content').load('home.php');
<iframe src="http://www.stackoverflow.com"></iframe>