MyBB Community Forums
define ajax in 1.8 - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Plugins (https://community.mybb.com/forum-73.html)
+---- Forum: Plugin Development (https://community.mybb.com/forum-68.html)
+---- Thread: define ajax in 1.8 (/thread-158579.html)



define ajax in 1.8 - majkiks - 2014-09-03

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?


RE: define ajax in 1.8 - TheGarfield - 2014-09-03

Try jQuery ?

$.ajax({
    url: 'xmlhttp.php',
    type: 'post',
    data: postData,
    success: function(response) {
        // do something with what xmlhttp.php sent
    }
});



RE: define ajax in 1.8 - Shade - 2014-09-03

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.