{"id":384,"date":"2025-06-05T11:00:34","date_gmt":"2025-06-05T03:00:34","guid":{"rendered":"https:\/\/myuutime.com\/?p=384"},"modified":"2025-06-17T08:49:32","modified_gmt":"2025-06-17T00:49:32","slug":"%e6%88%91%e7%9a%84web%e5%bc%80%e5%8f%91%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b0%ef%bc%88%e4%b8%80%ef%bc%89%ef%bc%9ahtml","status":"publish","type":"post","link":"https:\/\/myuutime.com\/?p=384","title":{"rendered":"\u6211\u7684web\u5f00\u53d1\u5b66\u4e60\u7b14\u8bb0\uff08\u4e00\uff09\uff1aHTML"},"content":{"rendered":"\n<p style=\"text-indent:2em;\"><strong>\u4e00\u3001html\u6574\u4f53\u7ed3\u6784\u4ee3\u7801<\/strong>\uff1a<\/p>\n\n\n\n<p style=\"text-indent:2em;\"re class=\"wp-block-code\"><code>\n&lt;!DOCTYPE html&gt;\n&lt;html lang=\"zh-CN\"&gt; &lt;!--\u6307\u5b9a\u7f51\u7ad9\u8bed\u8a00--&gt;\n&lt;head&gt;\n    &lt;meta charset=\"UTF-8\"&gt; &lt;!--\u6307\u5b9a\u7f51\u7ad9\u7f16\u7801--&gt;\n    &lt;title&gt;Myhome&lt;\/title&gt; &lt;!--\u6307\u5b9a\u7f51\u7ad9\u6807\u9898--&gt;\n    &lt;link rel=\"icon\" href=\"favicon.ico\" type=\"image\/x-icon\"&gt; &lt;!--\u6307\u5b9a\u7f51\u7ad9\u9996\u9875\u5de6\u4e0a\u89d2\u663e\u793a\u56fe\u6807--&gt;\n    &lt;link rel=\"stylesheet\" href=\"css\/me.css\"&gt;&lt;!-- \u5f15\u5165\u5916\u90e8CSS\u6587\u4ef6 --&gt;\n    \n    &lt;script src=\"js\/lunar.js\"&gt;&lt;\/script&gt;&lt;!-- \u5f15\u7528\u5916\u90e8JavaScript\u6587\u4ef6 --&gt;\n    &lt;script src=\"js\/jquery371.js\"&gt;&lt;\/script&gt;&lt;!-- \u5f15\u7528\u5916\u90e8JavaScript\u6587\u4ef6 --&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n    &lt;script src=\"js\/lunar.js\"&gt;&lt;\/script&gt;&lt;!-- \u5f15\u7528\u5916\u90e8JavaScript\u6587\u4ef6 --&gt;\n    &lt;script src=\"js\/jquery371.js\"&gt;&lt;\/script&gt;&lt;!-- \u5f15\u7528\u5916\u90e8JavaScript\u6587\u4ef6 --&gt;\n    &lt;script src=\"js\/me.js\"&gt;&lt;\/script&gt;&lt;!--\u5f15\u7528\u5916\u90e8JavaScript\u6587\u4ef6 --&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n\n\n\n<p style=\"text-indent:2em;\">1\u3001 \u5b9e\u8df5\u5fc3\u5f97\uff1a\u9664\u4e86\u522b\u4eba\u7684\u5e93\uff0c\u81ea\u5df1\u5199\u7684js\u6587\u4ef6\u8981\u653e\u5230\u6700\u5e95\u90e8\uff0c\u5c24\u5176\u662f\u8981\u9009\u53d6\u64cd\u4f5c\u9875\u9762\u76f8\u5173\u5143\u7d20\u65f6\uff0c\u5426\u5219\u4f1a\u627e\u4e0d\u5230\u5143\u7d20\u800c\u65e0\u6cd5\u663e\u793a\u6216\u6b63\u786e\u64cd\u4f5c\u3002<\/p>\n\n\n\n<p style=\"text-indent:2em;\">2\u3001\u5c06BING\u6bcf\u65e5\u56fe\u7247\u4f5c\u4e3a\u7f51\u7ad9\u7684\u80cc\u666f\u56fe\u7247\u663e\u793a\u4ee3\u7801\uff08php\u8bed\u8a00\u5b9e\u73b0\uff09\uff1a<\/p>\n\n\n\n<p style=\"text-indent:2em;\"re class=\"wp-block-code\"><code>&lt;?php\n\/\/\u5c06BING\u6bcf\u65e5\u56fe\u7247\u4f5c\u4e3a\u7f51\u7ad9\u80cc\u666f\n$bingurl = \"https:\/\/www.bing.com\/HPImageArchive.aspx?format=js&amp;idx=0&amp;n=1&amp;mkt=en-US\";\n$bingjson = file_get_contents($bingurl);\n$bingdata = json_decode($bingjson, true);\n$bingbaseurl=\"https:\/\/www.bing.com\";\n$imagetitle=$bingdata&#91;'images']&#91;0]&#91;'title'];\n$imagecopyright=$bingdata&#91;'images']&#91;0]&#91;'copyright'];\n$imageurl = $bingbaseurl . $bingdata&#91;'images']&#91;0]&#91;'urlbase'].'_1920x1080.jpg'; \/\/ 1080p\u56fe\u7247URL\n?&gt;<\/code><\/pre>\n\n\n\n<p style=\"text-indent:2em;\">3\u3001\u5728\u7f51\u9875\u4e0a\u5b9e\u65f6\u663e\u793a\u65f6\u95f4\uff08\u65f6:\u5206:\u79d2\uff09\u4ee3\u7801\uff08\u7528ajax\u548cjs\u4ee3\u7801\u5b9e\u73b0\uff09\uff1a<\/p>\n\n\n\n<p style=\"text-indent:2em;\"re class=\"wp-block-code\"><code>\/\/javascript\u4ee3\u7801\n\/\/ \u914d\u7f6e\u548c\u53d1\u9001\u5b9e\u65f6\u65f6\u95f4\u663e\u793a\u6570\u636eSTART\nrealtime();\nfunction realtime(){\nvar realtime2=new XMLHttpRequest();\nrealtime2.open('GET', '..\/realtime.php', true);\/\/\u6ce8\u610f\u6587\u4ef6\u76ee\u5f55\u8def\u5f84\nrealtime2.onreadystatechange = function () {\n    if (realtime2.readyState === 4 &amp;&amp; realtime2.status === 200) {\n        document.getElementById('realtime').innerHTML = realtime2.responseText;\n    }\n};\nrealtime2.send();\n}\nsetInterval(realtime, 1000);\n\/\/ \u914d\u7f6e\u548c\u53d1\u9001\u5b9e\u65f6\u65f6\u95f4\u663e\u793a\u6570\u636eEND\n\n\/\/realtime.php\u6587\u4ef6\u4ee3\u7801\n&lt;?php\ndate_default_timezone_set('Asia\/Shanghai');\/\/\u8bbe\u5b9a\u6b63\u786e\u65f6\u533a\necho date('H:i:s');\n?&gt;<\/code><\/pre>\n\n\n\n<p style=\"text-indent:2em;\">4\u3001\u5b9e\u8df5\u5fc3\u5f97\uff1ajavascript\u4e2d\u51fd\u6570\u540d\u79f0\u548c\u53d8\u91cf\u540d\u79f0\u6700\u597d\u4e0d\u8981\u91cd\u590d\uff0c\u5426\u5219\u5bb9\u6613\u62a5\u9519\u3002<\/p>\n\n\n\n<p style=\"text-indent:2em;\">5\u3001\u5c06BING\u6bcf\u65e5\u56fe\u7247\u4f5c\u4e3a\u7f51\u7ad9\u7684\u80cc\u666f\u56fe\u7247\u53e6\u7c7b\u65b9\u6cd5\u4ee3\u7801\uff08\u7528ajax\uff0cjs\u548cphp\u8bed\u8a00\u5b9e\u73b0\uff09\uff1a<\/p>\n\n\n\n<p style=\"text-indent:2em;\"re class=\"wp-block-code\"><code>\/\/js,ajax\u4ee3\u7801\n\/\/ \u914d\u7f6e\u548c\u53d1\u9001BING\u6bcf\u65e5\u58c1\u7eb8START\nbingday();\nfunction bingday(){\nvar bingday2=new XMLHttpRequest();\nbingday2.open('GET', '..\/bingday.php', true);\nbingday2.onreadystatechange = function () {\n    if (bingday2.readyState === 4 &amp;&amp; bingday2.status === 200) {\n        var bingday3=JSON.parse(bingday2.responseText);\/\/\u5c06json\u683c\u5f0f\u8f6c\u6362\u6210javascript\u683c\u5f0f\u7684\u6570\u636e\n        document.getElementById('homewrap').style.backgroundImage =`url('${bingday3.url}')`;\n    }\n};\nbingday2.send();\n}\n\/\/ \u914d\u7f6e\u548c\u53d1\u9001BING\u6bcf\u65e5\u58c1\u7eb8END\n\n\/\/php\u6587\u4ef6\u4ee3\u7801\n&lt;?php\n$bingurl = \"https:\/\/www.bing.com\/HPImageArchive.aspx?format=js&amp;idx=0&amp;n=1&amp;mkt=en-US\";\n$bingjson = file_get_contents($bingurl);\n$bingdata = json_decode($bingjson, true);\n$bingbaseurl=\"https:\/\/www.bing.com\";\n$imagetitle=$bingdata&#91;'images']&#91;0]&#91;'title'];\n$imagecopyright=$bingdata&#91;'images']&#91;0]&#91;'copyright'];\n$image1080purl = $bingbaseurl . $bingdata&#91;'images']&#91;0]&#91;'urlbase'].'_1920x1080.jpg'; \/\/ 1080p\u56fe\u7247URL\n$bingreturn=&#91;\"title\"=&gt;$imagetitle,'copy'=&gt;$imagecopyright,'url'=&gt;$image1080purl];\n$bingdata = json_encode($bingreturn);\/\/\u628aphp\u6570\u7ec4\u683c\u5f0f\u5305\u88c5\u6210json\u6570\u636e\u8fd4\u56de\necho $bingdata;\n?&gt;<\/code><\/pre>\n\n\n\n<p style=\"text-indent:2em;\">6\u3001\u7f51\u9875\u4e0a\u663e\u793a\u5f53\u5929\u65e5\u5386\u3001\u8f6c\u6362\u519c\u5386\u3001\u661f\u671f\u663e\u793a\u4ee3\u7801\uff1a\uff08\u9700\u8981\u52a0\u8f7dlunar.js\u5e93\uff09<\/p>\n\n\n\n<p style=\"text-indent:2em;\"re class=\"wp-block-code\"><code>\/\/\u914d\u7f6e\u5f53\u65e5\u516c\u5386\u3001\u519c\u5386\u65e5\u671f\u663e\u793a\nvar mysolar=new Date();\nvar mylunar = Lunar.fromDate(new Date());\/\/\u83b7\u53d6\u5f53\u524d\u65e5\u671f\u5e76\u8f6c\u6362\u6210\u519c\u5386\nvar solarday=mysolar.getFullYear()+\"\u5e74\"+(mysolar.getMonth()+1)+\"\u6708\"+mysolar.getDate()+\"\u65e5\";\/\/\u516c\u5386\u663e\u793a\u5f53\u5929\u65e5\u671f\nvar lunarday=mylunar.getYearInGanZhi()+\"\u5e74\"+mylunar.getMonthInChinese()+\"\u6708\"+mylunar.getDayInChinese()+\"\u65e5\";\/\/\u519c\u5386\u5f53\u5929\u65e5\u671f\nvar weekdays=&#91;\"\u661f\u671f\u65e5\",\"\u661f\u671f\u4e00\",\"\u661f\u671f\u4e8c\",\"\u661f\u671f\u4e09\",\"\u661f\u671f\u56db\",\"\u661f\u671f\u4e94\",\"\u661f\u671f\u516d\",]\/\/\u5229\u7528\u6570\u7ec4\u628a\u6570\u5b57\u5468\u8f6c\u6362\u6210\u4e2d\u6587\u661f\u671f\u663e\u793a\nvar weekday=weekdays&#91;mysolar.getDay()];\ndocument.getElementById('realdate').innerHTML =solarday+weekday+lunarday;<\/code><\/pre>\n\n\n\n<p style=\"text-indent:2em;\">7\u3001php\u4e2d\u622a\u53d6\u6307\u5b9a\u5b57\u7b26\u524d\u7684\u6240\u6709\u5b57\u7b26\u4e32\u51fd\u6570\uff1a<\/p>\n\n\n\n<p style=\"text-indent:2em;\"re class=\"wp-block-code\"><code>strstr(\u6574\u4f53\u5b57\u7b26\u4e32,'\u6307\u5b9a\u5b57\u7b26\u4e32',true);<\/code><\/pre>\n\n\n\n<p style=\"text-indent:2em;\">8\u3001javascript\u52a8\u6001\u5728\u9875\u9762\u4e2d\u63d2\u5165\u65b0\u5143\u7d20\u6216\u8282\u70b9\uff1a<\/p>\n\n\n\n<p style=\"text-indent:2em;\"re class=\"wp-block-code\"><code>                \/\/ \u521b\u5efa\u4e00\u4e2a\u65b0\u7684span\u5143\u7d20\n                var newspan = document.createElement(\"span\"); \n               \/\/ \u4e3a\u65b0span\u8bbe\u7f6eid,\u5176\u4ed6\u4e00\u4e9b\u5c5e\u6027\u6216\u5185\u5bb9\n               newspan.id = \"newstitle\";\n               \/\/ \u83b7\u53d6\u7236\u5143\u7d20\uff0c\u4f8b\u5982stockbox\n               var parentElement = document.getElementById(\"stockbox\");\n              \/\/ \u5c06\u65b0\u521b\u5efa\u7684span\u6dfb\u52a0\u5230\u7236\u5143\u7d20\u4e2d\n              parentElement.appendChild(newspan);<\/code><\/pre>\n\n\n\n<p style=\"text-indent:2em;\">9\u3001php\u4e2d\u7ed9\u5173\u8054\u6570\u7ec4\u8d4b\u503c\uff1a<\/p>\n\n\n\n<p style=\"text-indent:2em;\"re class=\"wp-block-code\"><code>&lt;?php\n$stockname = &#91;];\n$stockname&#91;]=&#91;'name'=> '\u6cf8\u5dde\u8001\u7a96','code'=>'000568','price'=>'188','rise'=>'8','dividend'=>'8','eps'=>'9'];\n$stockname&#91;]=&#91;'name'=> '\u4f0a\u5229\u80a1\u4efd','code'=>'000568','price'=>'188','rise'=>'8','dividend'=>'8','eps'=>'9'];\necho $stockname&#91;0]&#91;'name'];\necho $stockname&#91;1]&#91;'name'];\n?><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001html\u6574\u4f53\u7ed3\u6784\u4ee3\u7801\uff1a 1\u3001 \u5b9e\u8df5\u5fc3\u5f97\uff1a\u9664\u4e86\u522b\u4eba\u7684\u5e93\uff0c\u81ea\u5df1\u5199\u7684js\u6587\u4ef6\u8981\u653e\u5230\u6700\u5e95\u90e8\uff0c\u5c24\u5176\u662f\u8981\u9009\u53d6\u64cd\u4f5c\u9875\u9762\u76f8\u5173\u5143\u7d20\u65f6\uff0c\u5426\u5219\u4f1a\u627e\u4e0d\u5230\u5143\u7d20\u800c\u65e0\u6cd5\u663e\u793a\u6216\u6b63\u786e\u64cd\u4f5c\u3002 <\/p>\n","protected":false},"author":1,"featured_media":385,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-384","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tech","comments-off"],"_links":{"self":[{"href":"https:\/\/myuutime.com\/index.php?rest_route=\/wp\/v2\/posts\/384","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/myuutime.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/myuutime.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/myuutime.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/myuutime.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=384"}],"version-history":[{"count":16,"href":"https:\/\/myuutime.com\/index.php?rest_route=\/wp\/v2\/posts\/384\/revisions"}],"predecessor-version":[{"id":405,"href":"https:\/\/myuutime.com\/index.php?rest_route=\/wp\/v2\/posts\/384\/revisions\/405"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/myuutime.com\/index.php?rest_route=\/wp\/v2\/media\/385"}],"wp:attachment":[{"href":"https:\/\/myuutime.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=384"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/myuutime.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=384"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/myuutime.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=384"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}