2014-11-22 99 views
0

我加入custom.js我公司产品的编辑页面Magento的:在下拉菜单中更改自定义AJAX调用

我已经添加了ID“的GetData”现在就需要值显示基于什么用户另一个文件选择下拉菜单中的属性

我需要做的Ajax调用其他页面的DropDdown的值,调用Ajax很简单我想用magento调用Ajax url和loader的方式也怎么办?

我写了下面的代码,但它现在的工作

function myajaxcall(id){ 
new Ajax.Request('/a.php?id='+id, { 
    onSuccess: function(response) { 
    alert(response); 
    } 
}); 
} 

我失去了什么请帮助

回答

0

尝试使用下面的代码:

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...'); } 
}); 
}