[英]magento :custom ajax call on dropdown change
我向我的产品编辑页面添加了custom.js
我添加了ID为“ getdata”的属性,现在还有另一个文件,其中根据用户在下拉菜单中的选择显示值
我需要使用dropddown的值对其他页面进行ajax调用,调用ajax很简单,我想使用以调用ajax url和loader的方式构建的magento,我该怎么做?
我写了下面的代码,但现在可以工作了
function myajaxcall(id){
new Ajax.Request('/a.php?id='+id, {
onSuccess: function(response) {
alert(response);
}
});
}
我缺少什么帮助
尝试使用以下代码:
function myajaxcall(id){
new Ajax.Request('a.php?id='+id, {
method:'get',
onSuccess: function(data) {
var response = data.responseText || "no response text";
alert("Success! \n\n" + response);
},
onFailure: function() { alert('Something went wrong...'); }
});
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.