在尝试上传图像文件时,今天遇到一个有趣的问题<使用dojo.io.iframe 2MB. 我调用了处理表单的函数,但在将表单发布到服务器之前,我收到以下错误: TypeError:ifd.getElementsByTagName(“textarea”)[0]未定义 我用于处理表单帖子的函数是:
function uploadnewlogo(){
var logoDiv = dojo.byId('userlogo');
var logoMsg = dojo.byId('uploadmesg');
//prep the io frame to send logo data.
dojo.io.iframe.send({
url: "/users/profile/changelogo/",method: "post",handleAs: "text",form: dojo.byId('logoUploadFrm'),handle: function(data,ioArgs){
var response = dojo.fromJson(data);
if(response.status == 'success'){
//first clear the image
//dojo.style(logoDiv,"display","none");
logoDiv.innerHTML = "";
//then we update the image
logoDiv.innerHTML = response.image;
}else if(response.status == 'error'){
logoMsg.innerHTML = data.mesg;
}else{
logoMsg.innerHTML = '