From 9f0b284c894fb7d5b8fd3d8556659e4d7a177f8a Mon Sep 17 00:00:00 2001 From: nftstudio Date: Wed, 15 Jan 2020 16:33:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=95=E7=A5=A8=E7=B1=BB=E5=B8=96=E5=AD=90?= =?UTF-8?q?=20=E6=B7=BB=E5=8A=A0=E6=8A=95=E7=A5=A8=E9=A1=B9=E5=88=B0?= =?UTF-8?q?=E6=9C=80=E5=A4=A7=E6=95=B0=E9=87=8F=E6=97=B6=E7=BB=A7=E7=BB=AD?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20=E4=BC=9A=E6=9C=89=E4=B8=AAjs=E6=8A=A5?= =?UTF-8?q?=E9=94=99=20Uncaught=20TypeError:=20Cannot=20set=20property=20'?= =?UTF-8?q?outerHTML'=20of=20null=20at=20addpolloption=20(forum=5Fpost.js?= =?UTF-8?q?=3FYg3:1)=20at=20HTMLAnchorElement.onclick=20(forum.php=3Fmod?= =?UTF-8?q?=3Dpost&action=3Dnewthread&fid=3D2&special=3D1:348)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复: 将$('polloption_new').outerHTML = '已达到最大投票数'+maxoptions+''; 改成$('polloption_new').innerHTML = '已达到最大投票数' + maxoptions; 优化: 在删除添加的投票选项时,移除提示信息 添加: if (curoptions < maxoptions) { $('polloption_new').innerHTML = ''; } --- upload/static/js/forum_post.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/upload/static/js/forum_post.js b/upload/static/js/forum_post.js index 347d998a4..42da74f09 100644 --- a/upload/static/js/forum_post.js +++ b/upload/static/js/forum_post.js @@ -616,13 +616,16 @@ function addpolloption() { addUploadEvent(imgid, proid) } else { - $('polloption_new').outerHTML = '已达到最大投票数'+maxoptions+''; + $('polloption_new').innerHTML = '已达到最大投票数' + maxoptions; } } function delpolloption(obj) { obj.parentNode.parentNode.removeChild(obj.parentNode); curoptions--; + if (curoptions < maxoptions) { + $('polloption_new').innerHTML = ''; + } } function insertsave(pid) { -- Gitee