function get() {
$.post(
'postchatfame.php',
{
comment: postchatfamemsg.comment.value,
userid: postchatfamemsg.userid.value
},
function(output) {
$('#walls').html(output).show();
}
);
document.forms["postchatfamemsg"].reset();
}
This is my code I used as Ajax, to store information into DATABASE. and returned some information in tabular form to the same page without refreshing page.
I called this function onclick of button by writing this code.
<input name="a" type="button" value="Share" onClick="get();"/>
I suggest a different name for the function – some names already have a meaning in HTML and the DOM, so using such a name may conflict with them (calling a function
submithas similar problems).Why not give it a more descriptive name –
getChatFame, for example?