Reputation: 5087
This should work right? I have not a clue as to why it's not. I have to be doing something wrong.
<div id="randomdiv">text</div>
<a id="refresh">click</a>
<script>
$(function() {
$("#refresh").click(function() {
$("#randomdiv").load("index.php")
})
})
</script>
Upvotes: 8
Views: 82963
Reputation: 66436
What happen if you do this?
<a id="refresh" href="#">click</a>
<script>
$(function() {
$("#refresh").click(function(evt) {
$("#randomdiv").load("index.php")
evt.preventDefault();
})
})
</script>
Upvotes: 18