为什么这个简单的jQuery ajax不工作?
问题描述:
为什么这个简单的jQuery ajax代码不会将 pull.php
加载到 div
中 id
#alert
?
Why doesn't this simply jQuery ajax code not load pull.php
into the div
with id
of #alert
?
...
<script src="jquery.js"></script>
<script>
$(document).ready(function() {
$(".pull_button").click(function() {
$("#alert").load("pull.php");
});
});
</script>
</head>
<body>
<div id="#alert"></div>
<nav>
<a class="pull_button">Pull Data</a>
</nav>
...
答
c $ c># out of < div id =#alert>
。
<div id="alert"> -> $('#alert')
<div class="alert"> -> $('.alert')