views:

2597

answers:

1

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>
+4  A: 

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>
marcgg
When I do that, it works HAHA. Forgot to put the href, wow. Thanks!
Homework
Hurray! It's always nice when the first guess works
marcgg