在Opencart tpl文件中,我写了这个函数来执行php文件中的代码。但总是请求失败。这个功能出了什么问题?
function changeTexture(image,texture) {
//var type = type;
var request = $.ajax({
url: "http://localhost/opencart/customize/changetexture.php",
type: "GET",
data: { image: image, texture: texture}
});
request.done(function(msg) {
//if the requrest suceed
$("#iframe").attr("src", url);
});
request.fail(function(jqXHR, textStatus) {
alert( "Request failed: " );
});
}