Fiddle: http://jsfiddle.net/feqnLs6o/
I am trying to refresh <div id="refreshableDiv">
on button1
click, using jQuery.
I want to load the content of http://shiro-desu.com/scr/test/test.php
to the <div>
every time the button1
is clicked.
As i haven't used jQuery before, i fail to understand why the following doesn't reload the content of div.
script code:
$(document).ready(function(){
$('#button1').click(function(){
$.post(
"http://shiro-desu.com/scr/test/test.php",
{
},
function(data){
$('#refreshableDiv').html(data);
});
});
});
test.php
<?php echo "543"; ?>
html code:
<div id="refreshableDiv">Primary content</div>
<input type="submit" class="button1" name="button1" value="Reload"/>
Any ideas?