Probably a duplicate of a question somewhere, but I don't care. I've tried googling, but have not found an answer.
What am I doing wrong?
$(document).ready(function() {
$("#foo").click(function() {
$.ajax({
type : "POST",
cache : false,
url : "map.php?map=refresh",
data : $(this).serializeArray(),
success: function(data) {
$("#container").html(data);
}
});
});
});
I've tried .click(function() {, .sumbit(function() {, .bind("submit", function() {, and I believe others.
<form id="foo">
<div id="inner"><input id="move" name="left" type="button" value="LEFT" /></div>
<div id="inner"><input id="move" name="right" type="button" value="RIGHT" /></div>
<div id="inner"><input id="move" name="down" type="button" value="DOWN" /></div>
<div id="inner"><input id="move" name="up" type="button" value="UP" /></div>
</form>
I've got <div id="container" style="width:660px; height:660px;"> which contains a lot of stuff, but I'd just like it to be replaced:
WORKED