{"id":6448,"date":"2022-02-18T21:28:37","date_gmt":"2022-02-18T12:28:37","guid":{"rendered":"https:\/\/www.xenos.jp\/~zen\/blog2\/?p=6448"},"modified":"2022-02-18T21:28:39","modified_gmt":"2022-02-18T12:28:39","slug":"post-6448","status":"publish","type":"post","link":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/2022\/02\/18\/post-6448\/","title":{"rendered":"ASP.NET\u3067Chrome\u5bfe\u5fdc\u3057\u305f\u3089JS\u3067\u30c6\u30ad\u30b9\u30c8\u30dc\u30c3\u30af\u30b9\u306b\u5024\u304c\u5165\u3089\u306a\u304f\u306a\u3063\u305f\u3068\u304d\u306e\u5bfe\u5fdc"},"content":{"rendered":"\n<p>IE\u7528\u306b\u4f5c\u3089\u308c\u305fASP.NET\u306e\u30a2\u30d7\u30ea\u3092\u3001Chrome\u5bfe\u5fdc\uff08Chromium Edge\u5bfe\u5fdc\uff09\u3057\u3066\u3044\u308b\u3068\u304d\u306b\u3001JavaScript\u3067ASP.NET\u306e\u30d1\u30fc\u30c4\u306e\u30c6\u30ad\u30b9\u30c8\u30dc\u30c3\u30af\u30b9\uff08type=text\uff09\u306b\u5024\u3092\u3044\u308c\u305f\u3068\u3053\u308d\u3001\u5024\u304c\u5165\u3089\u306a\u3044\u3068\u3044\u3046\u3053\u3068\u304c\u304a\u304d\u305f\u3002\u300cgetElementById(&#8220;ID&#8221;).value\u300d\u306b\u3001JavaScript\u304b\u3089\u5024\u3092\u3044\u308c\u305f\u304c\u3001IE11\u3067\u306f\u554f\u984c\u306a\u3044\u306e\u306b\u3001Chrome\u3060\u3068\u5024\u304c\u5165\u3089\u306a\u304b\u3063\u305f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>document.getElementById(\"ID\").value = \"\u5024\";\n\/\/ \u2191\u3053\u308c\u3060\u3068\u3001IE11\u306f\u5024\u304c\u5165\u308b\u304c\u3001Chrome\u3060\u3068\u5165\u3089\u306a\u3044\u3002<\/code><\/pre>\n\n\n\n<p>PostBack\u306f\u767a\u751f\u3055\u305b\u3066\u3044\u306a\u3044\u51e6\u7406\u306a\u306e\u3060\u304c\u3002\u3044\u308d\u3044\u308d\u3068\u8abf\u3079\u3066\u3044\u304d\u3001Chrome\u306e\u5834\u5408\u306f\u300c.defaultValue\u300d\u3092\u4f7f\u3063\u3066\u521d\u671f\u72b6\u614b\u306e\u5024\u3092\u66f8\u304d\u63db\u3048\u308c\u3070\u3001\u753b\u9762\u306e\u8868\u793a\u304c\u5909\u308f\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3067\u304d\u305f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>document.getElementById(\"ID\").defaultValue = \"\u5024\";\n\/\/ \u2191Chrome\u306e\u5834\u5408\u306f\u3001defaultValue\u3092\u66f8\u304d\u63db\u3048\u308b\u3002<\/code><\/pre>\n\n\n\n<p>IE11\u3082\u6b8b\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u3063\u305f\u306e\u3067\u3001\u30d6\u30e9\u30a6\u30b6\u306e\u7a2e\u985e\u3092\u307f\u3066\u3001IF\u6587\u3067IE\u3068\u305d\u308c\u4ee5\u5916\u3067\u5206\u5c90\u3055\u305b\u308b\u3088\u3046\u306b\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u30b5\u30f3\u30d7\u30eb\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    \/\/ \u30d6\u30e9\u30a6\u30b6\u3092\u53d6\u5f97\u3059\u308b\n    var userAgent = window.navigator.userAgent.toLowerCase();\n    if (userAgent.indexOf('msie') != -1) {\n        \/\/ IE\u306e\u3068\u304d\u306e\u51e6\u7406\u3092\u66f8\u304f\n        document.getElementById(\"ID\").value = \"aaaa\";\n    } else {\n        \/\/ IE\u4ee5\u5916\u306e\u51e6\u7406\u3002Chrome\u3084Chromium Edge\u306e\u60f3\u5b9a\n        \/\/ document.getElementById.value \u3060\u3068\u3001\u753b\u9762\u4e0a\u306e\u8868\u793a\u304c\u5909\u308f\u3089\u306a\u3044\u3053\u3068\u304c\u308f\u304b\u3063\u305f\u3002\n        \/\/ \u305d\u306e\u305f\u3081\u3001document.getElementById.defaultValue \u306b\u5909\u66f4\u3057\u305f\u3068\u3053\u308d\u3001\u3046\u307e\u304f\u3044\u3063\u305f\u3002\n        document.getElementById(\"ID\").defaultValue = \"aaaa\";\n    }<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>IE\u7528\u306b\u4f5c\u3089\u308c\u305fASP.NET\u306e\u30a2\u30d7\u30ea\u3092\u3001Chrome\u5bfe\u5fdc\uff08Chromium Edge\u5bfe\u5fdc\uff09\u3057\u3066\u3044\u308b\u3068\u304d\u306b\u3001JavaScript\u3067ASP.NET\u306e\u30d1\u30fc\u30c4\u306e\u30c6\u30ad\u30b9\u30c8\u30dc\u30c3\u30af\u30b9\uff08type=text\uff09\u306b\u5024\u3092\u3044\u308c\u305f\u3068\u3053\u308d\u3001\u5024\u304c\u5165\u3089 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[95,52,224],"class_list":["post-6448","post","type-post","status-publish","format-standard","hentry","category-tech-memo","tag-asp-net","tag-chrome","tag-javascript"],"_links":{"self":[{"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/posts\/6448","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/comments?post=6448"}],"version-history":[{"count":1,"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/posts\/6448\/revisions"}],"predecessor-version":[{"id":6449,"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/posts\/6448\/revisions\/6449"}],"wp:attachment":[{"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/media?parent=6448"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/categories?post=6448"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/tags?post=6448"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}