{"id":159,"date":"2009-01-05T12:07:36","date_gmt":"2009-01-05T12:07:36","guid":{"rendered":""},"modified":"2009-01-05T12:07:36","modified_gmt":"2009-01-05T12:07:36","slug":"159","status":"publish","type":"post","link":"https:\/\/www.poloo.org\/?p=159","title":{"rendered":"javascript\u52a8\u6001\u521b\u5efa\u5220\u9664\u8868\u683c"},"content":{"rendered":"<div class=\"UBBPanel\">\n<div class=\"UBBTitle\"><img decoding=\"async\" src=\"images\/html.gif\" style=\"margin:0px 2px -3px 0px\"> HTML\u4ee3\u7801<\/div>\n<div class=\"UBBContent\"><TEXTAREA rows=\"8\" id=\"temp18532\"><br \/>\n<meta http-equiv=\"Content-Type\" content=\"text\/html; charset=gbk\" \/><br \/>\n<TABLE id=\"cssrain\" style=\"border:1px solid #000;width:200px;\" border=\"1\" cellpadding=\"0\" cellspacing=\"0\"> <\/p>\n<tr>\n<td width=\"50%\">\u59d3\u540d<\/td>\n<td width=\"50%\" colspan=\"2\" align=\"center\">\u5730\u5740<\/td>\n<\/tr>\n<p><\/TABLE><br \/>\n<input type=\"button\" onclick=\"addRow()\" value=\"add\" \/><br \/>\n<input type=\"button\" onclick=\"delRow()\" value=\"del\" \/><br \/>\n<script> \nfunction addRow(){ \nvar table = document.getElementById(\"cssrain\"); \n  if(table) \n  { \n   var newTr = document.createElement(\"tr\"); \n  if(newTr) \n  { \n   \/\/\u521b\u5efa\u7b2c\u4e00\u5217 \n       var td_customer = document.createElement(\"td\"); \n       td_customer.align = \"center\"; \/\/\u8bbe\u7f6e\u4f4d\u7f6e\n       td_customer.width = \"19%\" ;   \/\/\u8bbe\u7f6e\u5bbd\u5ea6\n       td_customer.innerHTML = \"aaa\"; \/\/\u8868\u683c\u5185\u5bb9(\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u4e2d\u8bfb\u53d6)\n       td_customer.id = \"tID\";\/\/\u8bbe\u7f6e\u5176ID\n       td_customer.style.cursor = \"hand\";\/\/\u8bbe\u7f6e\u5176\u6837\u5f0f,\u7c7b\u4f3c\u8d85\u94fe\u63a5\u624b\u5f62\n       td_customer.style.whiteSpace = \"nowrap\";\n       td_customer.style.backgroundColor = \"red\"; \/\/\u80cc\u666f\u8272\n       \/**\n        td_customer.style.   :.\u540e\u9762\u53ef\u4ee5\u63a5html\u4e2dstyle\u4e2d\u7684\u4efb\u4f55\u5c5e\u6027,\u53ea\u662fstyle\u4e2d\u7684\u5e26\"-\"\u7684\u8981\u53bb\u6389,javascript\u4e2d\u4e0d\u652f\u6301,\n        \u4e14\"-\"\u540e\u7684\u7b2c\u4e00\u4e2a\u5b57\u6bcd\u8981\u5927\u5199.\n        *\/\n       if(td_customer) \n            newTr.appendChild(td_customer);\n       \/\/\u521b\u5efa\u7b2c\u4e8c\u5217 \n       var td_panyment = document.createElement(\"td\"); \n       td_panyment.align = \"center\"; \n       td_panyment.colSpan= \"2\"; \/\/\u6ce8\u610f\u8fd9\u91cc\u662f\u5927\u5199 colSpan \u800c\u4e0d\u662fcolspan \u6ce8\u610f\u5927\u5c0f\u5199\n       td_panyment.innerHTML= \"bbb\"; \n       if(td_panyment)\n           newTr.appendChild(td_panyment);\n       var tbody = document.createElement(\"TBODY\");\/\/\u8fd9\u4e00\u6b65 \u4e0d\u80fd\u5c11 \n           tbody.appendChild(newTr);\/\/\u8fd9\u4e00\u6b65 \u4e0d\u80fd\u5c11 \n           table.appendChild(tbody); \n  }else{ \n          alert(\"\u884c\u4e0d\u5b58\u5728\"); \n  } \n  }else{ \n          alert(\"\u8868\u683c\u4e0d\u5b58\u5728\"); \n  } \n} <\/p>\n<p>function delRow()\n{\n    var tableID = document.getElementById(\"cssrain\");                \n    var rowLength = tableID.rows.length;\n    if(rowLength == 1)return;\n    tableID.deleteRow(rowLength-1);    \/\/\u5220\u9664\u6700\u4e0b\u9762\u7684\u884c\n}\n<\/script><br \/>\n<\/TEXTAREA><br \/><INPUT onclick=\"runEx('temp18532')\"  type=\"button\" class=\"userbutton\" value=\"\u8fd0\u884c\u6b64\u4ee3\u7801\"\/> <INPUT onclick=\"doCopy('temp18532')\"  type=\"button\" class=\"userbutton\" value=\"\u590d\u5236\u6b64\u4ee3\u7801\"\/> <INPUT onclick=\"saveCode('temp18532')\" type=\"button\" class=\"userbutton\" value=\"\u4fdd\u5b58\u6b64\u4ee3\u7801\"><br \/> [Ctrl+A \u5168\u90e8\u9009\u62e9 \u63d0\u793a\uff1a\u4f60\u53ef\u5148\u4fee\u6539\u90e8\u5206\u4ee3\u7801\uff0c\u518d\u6309\u8fd0\u884c]<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>HTML\u4ee3\u7801 \u59d3\u540d \u5730\u5740 [Ctrl+A \u5168\u90e8\u9009\u62e9 \u63d0\u793a\uff1a\u4f60\u53ef\u5148\u4fee\u6539&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-159","post","type-post","status-publish","format-standard","hentry","category-Dream"],"_links":{"self":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/posts\/159","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=159"}],"version-history":[{"count":0,"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/posts\/159\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=159"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=159"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=159"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}