{"id":834,"date":"2018-10-06T21:31:41","date_gmt":"2018-10-06T12:31:41","guid":{"rendered":"https:\/\/yuis-programming.com\/?p=834"},"modified":"2021-11-05T12:05:57","modified_gmt":"2021-11-05T03:05:57","slug":"url%e3%81%8b%e3%82%89%e3%82%af%e3%82%a8%e3%83%aa%e3%82%b9%e3%83%88%e3%83%aa%e3%83%b3%e3%82%b0%e3%82%92%e5%89%8a%e9%99%a4%e3%81%99%e3%82%8bjavascript%e3%82%92%e6%9b%b8%e3%81%84%e3%81%9f","status":"publish","type":"post","link":"https:\/\/yuis-programming.com\/?p=834","title":{"rendered":"URL\u304b\u3089\u30af\u30a8\u30ea\u30b9\u30c8\u30ea\u30f3\u30b0\u3092\u524a\u9664\u3059\u308bJavaScript\u3092\u66f8\u3044\u305f"},"content":{"rendered":"<p>Amazon\u3067\u3082Google\u3067\u3082\u306a\u3093\u3067\u3082\u3001URL\u3092\u30b7\u30a7\u30a2\u3059\u308b\u969b\u306b\u3001<code>?hoge=value&amp;fuga=value<\/code>\u3068\u3044\u3063\u305f\u3088\u3046\u306a\u30af\u30a8\u30ea\u30b9\u30c8\u30ea\u30f3\u30b0\u60c5\u5831\u304c\u90aa\u9b54\u3060\u3063\u305f\u308a\u3001\u500b\u4eba\u60c5\u5831\u3092\u542b\u3093\u3067\u3044\u305f\u308a\u3063\u3066\u3044\u3046\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u305d\u3046\u3044\u3046\u3068\u304d\u306b\u3001\u30d1\u30d1\u3063\u3068\u30b7\u30e7\u30fc\u30c8\u30ab\u30c3\u30c8\u30ad\u30fc\u3067\u30af\u30a8\u30ea\u30b9\u30c8\u30ea\u30f3\u30b0\u3092\u524a\u9664\u3057\u305fURL\u306b\u98db\u3079\u305f\u3089\u3044\u3044\u304b\u306a\u3001\u3068\u601d\u3044\u307e\u3057\u305f\u3002<br \/>\n\u305d\u308c\u3067\u3001URL\u304b\u3089\u30af\u30a8\u30ea\u30b9\u30c8\u30ea\u30f3\u30b0\u3092\u524a\u9664\u3059\u308bJavaScript\u3092\u66f8\u304d\u307e\u3057\u305f\u3002<\/p>\n<pre><code>function getPathFromUrl(url) {\n  return url.split(\/[?#]\/)[0];\n}\n\nvar window.location.href = getPathFromUrl(document.location.href)\n\n<\/code><\/pre>\n<p>\u3061\u306a\u307f\u306b\u30af\u30a8\u30ea\u30b9\u30c8\u30ea\u30f3\u30b0\u3067\u306f\u306a\u304f\u30af\u30a8\u30ea\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u524a\u9664\u3057\u305f\u3044\u3063\u3066\u5834\u5408\u306f\u3001<a href=\"https:\/\/stackoverflow.com\/questions\/1634748\/how-can-i-delete-a-query-string-parameter-in-javascript\">How can I delete a query string parameter in JavaScript? &#8211; Stack Overflow<\/a>\u304c\u53c2\u8003\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre><code>\/\/ google.com\/hoge?hoge=value&amp;key=value\nremoveUrlParameter(document.location.href,'key')\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Amazon\u3067\u3082Google\u3067\u3082\u306a\u3093\u3067\u3082\u3001URL\u3092\u30b7\u30a7\u30a2\u3059\u308b\u969b\u306b\u3001?hoge=value&amp;fuga=v [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[1],"tags":[],"acf":[],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8Rxwo-ds","_links":{"self":[{"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/posts\/834"}],"collection":[{"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=834"}],"version-history":[{"count":3,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/posts\/834\/revisions"}],"predecessor-version":[{"id":3301,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/posts\/834\/revisions\/3301"}],"wp:attachment":[{"href":"https:\/\/yuis-programming.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=834"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=834"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=834"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}