This is what I usually see:
$("button").click(function(){
$.post("demo_test.asp", function(data, status){
alert("Data: " + data + "\nStatus: " + status);
});
});
But I want to do this and it isn't really working:
<input type="submit" class='button_red' value="Create Pool" id="button" onclick="CreatePool()"><br />
function CreatePool(){
$.post("demo_test.asp", function(data, status){
alert("Data: " + data + "\nStatus: " + status);
});
}
Why not and shouldn't it? I'm getting the impression post will only work inside an event listener... but the above are just two ways of saying the same thing correct?