My first question 🙂
I am using Mootools and i have a JavaScript function, my issue is how to post data to form without refreshing the page.
I think that my code is not working with Mootools, Please check and advise
<script type="text/javascript">
function (PostData) {
$.ajax({
type: "POST",
url: "form.php",
data: { userid: 1111, test: 'test'}
})
}
</script>
Thanks
As it was already stated. the $.ajax method is a Jquery method. If you want to do it in mootools you should use the Request Class.
Here’s the Mootools request documentation in case you want (and should) dig a little deeper.
Here’s what you want to achieve using Mootools
You could also use the Request.JSON object, which automatically decodes the response into a Json object.