load content of file with jquery
I have a php file sitting in a directory. The file has some content to it that is just html. All I would like to do is to use JQuery to get the file contents and place then in a div on my page.
$(".page-intro").load("barware-title.php");
I have tried to use above code to load the page, but nothing happens.
Here is my Div
<div id="page-intro"></div>
I am at a loss for why this isn't working.
开发者_运维技巧Thanks for the help.
You need to address by id (#), not class (.)
$("#page-intro").load("barware-title.php");
Your selector is wrong. You should use
$('#page-intro')
The .page-intro is looking for a class name of page-intro.
Change .page-intro
to #page-intro
. It's an id not a class.
精彩评论