$ delete_commant = l (t ('X'), $ url, array ('attribute' =>
массив ('onclick' => 'return call_ajax (123)')));
когда я помещаю оповещение в определение функции call_ajax, оно оповещается, поэтому я продолжаю писать метод записи ajax, но когда я нажимаю на страницу ссылки, получая обновление,
Как реализовать Ajax в Drupal
function call_ajax(str){alert(str);
var url = "post.php";
var params = "lorem=ipsum&name=binny";
http.open("POST", url, true);
//Send the proper header information along with the request
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader("Content-length", params.length);
http.setRequestHeader("Connection", "close");
http.onreadystatechange = function() {//Call a function when the state changes.
if(http.readyState == 4 && http.status == 200) {
alert(http.responseText);
}
}
http.send(params);
}