Archived
1
0

"" -> null aka, js is shit

This commit is contained in:
Jeff Becker 2016-05-01 17:48:17 -04:00
parent 331fed1731
commit c8e8ab95cd
No known key found for this signature in database
GPG Key ID: AB950234D6EA286B
2 changed files with 2 additions and 2 deletions

View File

@ -184,7 +184,7 @@ DynReply.prototype.clearPostbox = function() {
e = document.getElementById("postform_message"); e = document.getElementById("postform_message");
e.value = ""; e.value = "";
e = document.getElementById("postform_attachments"); e = document.getElementById("postform_attachments");
e.value = ""; e.value = null;
} }
DynReply.prototype.post = function(cb, err_cb) { DynReply.prototype.post = function(cb, err_cb) {

View File

@ -25,7 +25,7 @@ DynReply.prototype.show=function(){console.log("show dynreply");this.update();th
DynReply.prototype.hide=function(){console.log("hide dynreply");this.elem.style.display="none";} DynReply.prototype.hide=function(){console.log("hide dynreply");this.elem.style.display="none";}
DynReply.prototype.clear=function(){this.clearSolution();this.clearPostbox();} DynReply.prototype.clear=function(){this.clearSolution();this.clearPostbox();}
DynReply.prototype.clearSolution=function(){var e=document.getElementById("captcha_solution");e.value="";} DynReply.prototype.clearSolution=function(){var e=document.getElementById("captcha_solution");e.value="";}
DynReply.prototype.clearPostbox=function(){var e=document.getElementById("postform_subject");e.value="";e=document.getElementById("postform_message");e.value="";e=document.getElementById("postform_attachments");e.value="";} DynReply.prototype.clearPostbox=function(){var e=document.getElementById("postform_subject");e.value="";e=document.getElementById("postform_message");e.value="";e=document.getElementById("postform_attachments");e.value=null;}
DynReply.prototype.post=function(cb,err_cb){if(this.url&&this.form){var data=new FormData(this.form);var ajax=new XMLHttpRequest();ajax.onreadystatechange=function(ev){if(ajax.readyState==XMLHttpRequest.DONE){var j=null;try{j=JSON.parse(ajax.responseText);cb(j);}catch(e){if(err_cb){err_cb(e);}}}} DynReply.prototype.post=function(cb,err_cb){if(this.url&&this.form){var data=new FormData(this.form);var ajax=new XMLHttpRequest();ajax.onreadystatechange=function(ev){if(ajax.readyState==XMLHttpRequest.DONE){var j=null;try{j=JSON.parse(ajax.responseText);cb(j);}catch(e){if(err_cb){err_cb(e);}}}}
ajax.open("POST",this.url);ajax.send(data);}} ajax.open("POST",this.url);ajax.send(data);}}
DynReply.prototype.updateCaptcha=function(){if(this.prefix){var captcha_img=document.getElementById("captcha_img");captcha_img.src=this.prefix+"captcha/img";} DynReply.prototype.updateCaptcha=function(){if(this.prefix){var captcha_img=document.getElementById("captcha_img");captcha_img.src=this.prefix+"captcha/img";}