【发布时间】:2012-09-27 06:31:14
【问题描述】:
可能重复:
Detecting Ajax in PHP and making sure request was from my own website
我有一个上传图片的表格,我正在使用Ajaxform()
$('#uploadformimage').ajaxForm({
beforeSend: function() {
$(".progress").css("display","block");
$("#response").html("");
status.empty();
var percentVal = '0%';
bar.width(percentVal)
percent.html(percentVal);
},
uploadProgress: function(event, position, total, percentComplete) {
var percentVal = percentComplete + '%';
bar.width(percentVal)
percent.html(percentVal);
//console.log(percentVal, position, total);
},
complete: function(xhr) {
$(".bar").css("width","100%");
$(".percent").html("100%").delay("8000").parent().slideUp(1000);
$("#response").html(xhr.responseText);
}
});
这是我的 javascript 代码。我想知道server-side 表单是不是由 ajax 上传的?
Javascript 可能在某些计算机上被禁用,所以我想显示一些不同的数据?
【问题讨论】:
-
在提出您的问题之前,请使用搜索。我刚刚在搜索中粘贴了您的问题标题:stackoverflow.com/… - 请参阅stackoverflow.com/questions/ask-advice
-
@hakre 没有必要每个人都知道一切。你应该看到这个User hakre
-
这不是不使用搜索的借口。