没有库的等效代码 [英] Equivalent code without the library
本文介绍了没有库的等效代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用了一个教程来获取以下ajax代码。在本教程中,他们拥有库 jquery.form.js 。以下是代码:
I used a tutorial to get the following ajax code. In the tutorial, they have the library jquery.form.js. Here is the code:
function onsuccess(response,status){
$("#onsuccessmsg").html(response);
alert(response);
}
$("#uploadform").on('change',function(){
var options={
url : $(this).attr("action"),
success : onsuccess
};
$(this).ajaxSubmit(options);
return false;
});
如果我不想jquery.form.js 已实施。普通ajax(没有库)的等效代码是什么?
What if I don't want to have jquery.form.js implemented. What would be the equivalent code with normal ajax (without the library)?
推荐答案
( #onsuccessmsg跨度>)HTML(响应);
alert(回复);
}
("#onsuccessmsg").html(response); alert(response); }
( #uploadform) .on(' change', function (){
var options = {
url:
("#uploadform").on('change',function(){ var options={ url :
(此)。attr( action),
成功:onsuccess
};
(this).attr("action"), success : onsuccess };
这篇关于没有库的等效代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文