MyBB Community Forums

Full Version: define ajax in 1.8
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
if in 1.6 in myfile.js I have thst and work

new Ajax.Request('xmlhttp.php', {method: 'post', postBody: postData, onComplete: function(request)

why this do not work in 1.8?
Try jQuery ?

$.ajax({
    url: 'xmlhttp.php',
    type: 'post',
    data: postData,
    success: function(response) {
        // do something with what xmlhttp.php sent
    }
});
The fact is, MyBB 1.8 moved from Prototype to jQuery in its javascript main library. JS code designed for 1.6 won't likely work within 1.8 environment.