如何通过jQuery的加载PHP文件到DIV?
问题描述:
我正在开发一个网站,我有这个侧面菜单上的:
I am developing a website and I have this on the side menu :
< A HREF =#级=leftMenuID =接触与GT;联系我们< / A>
然后,我有这个剧本
$(document).ready(function(){
$("#contact").click(function(){
$("#contents").load('home.php');
});
});
和我有这个DIV在我的网页:
and I have this DIV inside my page :
< DIV CLASS =contentWrapperID =内容>< / DIV>
很显然,我所要做的是加载home.php当我点击联系我们的超链接,这是行不通的。什么是错我的code?
Obviously, what I am trying to do is to load home.php when I click on the Contact Us hyperlink, which doesn't work. What is wrong with my code?
答
补充,而不是文件名 home.php
页面的URL。
add home.php
page url instead of file name.
$(document).ready(function(){
$("#contact").click(function(){
$("#contents").load('url to home.php');
});
});