{"id":1037,"date":"2022-03-30T11:39:42","date_gmt":"2022-03-30T06:09:42","guid":{"rendered":"https:\/\/vining.in\/blog\/?p=1037"},"modified":"2022-03-30T11:38:57","modified_gmt":"2022-03-30T06:08:57","slug":"how-to-get-current-url-with-jquery","status":"publish","type":"post","link":"https:\/\/vining.in\/blog\/how-to-get-current-url-with-jquery\/","title":{"rendered":"How to get current URL with jQuery?"},"content":{"rendered":"<p>http:\/\/www.domain.com:8082\/index.php#tab2?foo=123<\/p>\n<table style=\"width: 492px; height: 275px;\">\n<tbody>\n<tr>\n<td style=\"width: 100px;\">Property<\/td>\n<td>Result<\/td>\n<\/tr>\n<tr>\n<td>host<\/td>\n<td>www.domain.com:8082<\/td>\n<\/tr>\n<tr>\n<td>hostname<\/td>\n<td>www.domain.com<\/td>\n<\/tr>\n<tr>\n<td>port<\/td>\n<td>8082<\/td>\n<\/tr>\n<tr>\n<td>protocol<\/td>\n<td>http:<\/td>\n<\/tr>\n<tr>\n<td>pathname<\/td>\n<td>index.php<\/td>\n<\/tr>\n<tr>\n<td>href<\/td>\n<td>http:\/\/www.domain.com:8082\/index.php#tab2<\/td>\n<\/tr>\n<tr>\n<td>hash<\/td>\n<td>#tab2<\/td>\n<\/tr>\n<tr>\n<td>search<\/td>\n<td>?foo=789<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>var x = $(location).attr(&#8216;&lt;property&gt;&#8217;);<\/p>\n","protected":false},"excerpt":{"rendered":"<p>http:\/\/www.domain.com:8082\/index.php#tab2?foo=123 Property Result host www.domain.com:8082 hostname www.domain.com port 8082 protocol http: pathname index.php href http:\/\/www.domain.com:8082\/index.php#tab2 hash #tab2 search ?foo=789 var x = $(location).attr(&#8216;&lt;property&gt;&#8217;);<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,18],"tags":[],"class_list":["post-1037","post","type-post","status-publish","format-standard","hentry","category-javascript","category-jquery-plugins"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to get current URL with jQuery? - Programmer Code<\/title>\n<meta name=\"description\" content=\"How to get current URL with jQuery?\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/vining.in\/blog\/how-to-get-current-url-with-jquery\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to get current URL with jQuery? - Programmer Code\" \/>\n<meta property=\"og:description\" content=\"How to get current URL with jQuery?\" \/>\n<meta property=\"og:url\" content=\"https:\/\/vining.in\/blog\/how-to-get-current-url-with-jquery\/\" \/>\n<meta property=\"og:site_name\" content=\"Programmer Code\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/vining.in\" \/>\n<meta property=\"article:published_time\" content=\"2022-03-30T06:09:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-03-30T06:08:57+00:00\" \/>\n<meta name=\"author\" content=\"codeadmin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"codeadmin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/vining.in\/blog\/how-to-get-current-url-with-jquery\/\",\"url\":\"https:\/\/vining.in\/blog\/how-to-get-current-url-with-jquery\/\",\"name\":\"How to get current URL with jQuery? - Programmer Code\",\"isPartOf\":{\"@id\":\"https:\/\/vining.in\/blog\/#website\"},\"datePublished\":\"2022-03-30T06:09:42+00:00\",\"dateModified\":\"2022-03-30T06:08:57+00:00\",\"author\":{\"@id\":\"https:\/\/vining.in\/blog\/#\/schema\/person\/cda9f07adf3479ac270e2320a914552e\"},\"description\":\"How to get current URL with jQuery?\",\"breadcrumb\":{\"@id\":\"https:\/\/vining.in\/blog\/how-to-get-current-url-with-jquery\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/vining.in\/blog\/how-to-get-current-url-with-jquery\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/vining.in\/blog\/how-to-get-current-url-with-jquery\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/vining.in\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to get current URL with jQuery?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/vining.in\/blog\/#website\",\"url\":\"https:\/\/vining.in\/blog\/\",\"name\":\"Programmer Code\",\"description\":\"- Where Developers Learn, Share, &amp; Build Careers\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/vining.in\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/vining.in\/blog\/#\/schema\/person\/cda9f07adf3479ac270e2320a914552e\",\"name\":\"codeadmin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/vining.in\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/770f5bb2b95d41f98f29e7251fb1873b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/770f5bb2b95d41f98f29e7251fb1873b?s=96&d=mm&r=g\",\"caption\":\"codeadmin\"},\"url\":\"https:\/\/vining.in\/blog\/author\/codeadmin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to get current URL with jQuery? - Programmer Code","description":"How to get current URL with jQuery?","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/vining.in\/blog\/how-to-get-current-url-with-jquery\/","og_locale":"en_US","og_type":"article","og_title":"How to get current URL with jQuery? - Programmer Code","og_description":"How to get current URL with jQuery?","og_url":"https:\/\/vining.in\/blog\/how-to-get-current-url-with-jquery\/","og_site_name":"Programmer Code","article_publisher":"https:\/\/www.facebook.com\/vining.in","article_published_time":"2022-03-30T06:09:42+00:00","article_modified_time":"2022-03-30T06:08:57+00:00","author":"codeadmin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"codeadmin","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/vining.in\/blog\/how-to-get-current-url-with-jquery\/","url":"https:\/\/vining.in\/blog\/how-to-get-current-url-with-jquery\/","name":"How to get current URL with jQuery? - Programmer Code","isPartOf":{"@id":"https:\/\/vining.in\/blog\/#website"},"datePublished":"2022-03-30T06:09:42+00:00","dateModified":"2022-03-30T06:08:57+00:00","author":{"@id":"https:\/\/vining.in\/blog\/#\/schema\/person\/cda9f07adf3479ac270e2320a914552e"},"description":"How to get current URL with jQuery?","breadcrumb":{"@id":"https:\/\/vining.in\/blog\/how-to-get-current-url-with-jquery\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/vining.in\/blog\/how-to-get-current-url-with-jquery\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/vining.in\/blog\/how-to-get-current-url-with-jquery\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/vining.in\/blog\/"},{"@type":"ListItem","position":2,"name":"How to get current URL with jQuery?"}]},{"@type":"WebSite","@id":"https:\/\/vining.in\/blog\/#website","url":"https:\/\/vining.in\/blog\/","name":"Programmer Code","description":"- Where Developers Learn, Share, &amp; Build Careers","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/vining.in\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/vining.in\/blog\/#\/schema\/person\/cda9f07adf3479ac270e2320a914552e","name":"codeadmin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/vining.in\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/770f5bb2b95d41f98f29e7251fb1873b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/770f5bb2b95d41f98f29e7251fb1873b?s=96&d=mm&r=g","caption":"codeadmin"},"url":"https:\/\/vining.in\/blog\/author\/codeadmin\/"}]}},"_links":{"self":[{"href":"https:\/\/vining.in\/blog\/wp-json\/wp\/v2\/posts\/1037","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vining.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vining.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vining.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vining.in\/blog\/wp-json\/wp\/v2\/comments?post=1037"}],"version-history":[{"count":4,"href":"https:\/\/vining.in\/blog\/wp-json\/wp\/v2\/posts\/1037\/revisions"}],"predecessor-version":[{"id":1041,"href":"https:\/\/vining.in\/blog\/wp-json\/wp\/v2\/posts\/1037\/revisions\/1041"}],"wp:attachment":[{"href":"https:\/\/vining.in\/blog\/wp-json\/wp\/v2\/media?parent=1037"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vining.in\/blog\/wp-json\/wp\/v2\/categories?post=1037"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vining.in\/blog\/wp-json\/wp\/v2\/tags?post=1037"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}