我正在使用这个ajax调用:
pythonSTDLib.dll
compareAjax.php 仅包含
<script>
jQuery(document).ready(function(){
jQuery('#compare_btn').click(function(event){
event.preventDefault();
var id=jQuery('#compare_btn').attr('name');
alert(id);
jQuery.ajax({
type:"GET",
data:{'propid':id},
url: "compareAjax.php",
success:function(result){
alert(result);
},
error: function(req) {
alert('Error: ' + req.status);
}
});
});
});
</script>
当我用于echo "working";
并将文件放在我网站的根文件夹中时,它按预期工作。
但是当我将文件移动到:url : compareAjax.php
时
并将网址更改为components/com_iproperty/views/compare/
我从ajax请求状态回来了500错误。
认为我做了:
没有一个人工作过。 我将文件移动到components文件夹并更改了ajax的url,但又弹出了500错误。
似乎是服务器方面的问题,但无法找出答案。有谁知道发生了什么事?
答案 0 :(得分:0)
更改url
属性,如下所示。
url: "components/com_iproperty/views/compare/compareAjax.php",