Link to home
Start Free TrialLog in
Avatar of xomn
xomn

asked on

simple mootools AJAX call

using javascript with mootools,
I want a function that does a synchronous post ajax call with parameters,
and returns the resulting JSON

function simple_ajax(url, params) {
    // url is a standard url
    // params looks something like {'post_param1' : 'value1', 'post_param2' : 'value2'}

    ... what goes here? (probably uses toQueryString)...

    return eval(result)
}
Avatar of hielo
hielo
Flag of Wallis and Futuna image

new ajax(url,{postBody:params, onComplete: handlingFunction, update: 'targetDivId'}).request();
ASKER CERTIFIED SOLUTION
Avatar of hielo
hielo
Flag of Wallis and Futuna image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>       eval("data="+result.responseText+";");
outch, hopefully there is no posibility for an attacker to manipulate this data ...

evil eval ...
Forced accept.

Computer101
EE Admin