• Web APIs
  • Location interface is a search string, also called a query string, that is a string containing a "?" followed by the parameters of the location's URL. If the URL does not have a search query, this property contains an empty string, "".

    This property can be set to change the query string of the URL. When setting, a single "?" prefix is added to the provided value, if not already present. Setting it to "" removes the query string.

    The query is percent-encoded when setting but not percent-decoded when reading.

    Modern browsers provide URLSearchParams and URL.searchParams to make it easy to parse out the parameters from the querystring.

    See

  • Specifications

    Specification
    Product help
  • Instance properties
    1. hostname
    2. port
    3. reload()
    4. toString()
  • ","source":{"folder":"en-us/web/api/location/search","github_url":"https://github.com/mdn/content/blob/main/files/en-us/web/api/location/search/index.md","last_commit_url":"https://github.com/mdn/content/commit/8cc63f7e6619446ea38f6a38c457a597a9af564b","filename":"index.md"},"summary":"The search property of the Location interface is a search string, also called a query string, that is a string containing a \"?\" followed by the parameters of the location's URL. If the URL does not have a search query, this property contains an empty string, \"\".","title":"Location: search property","toc":[{"text":"Value","id":"value"},{"text":"Examples","id":"examples"},{"text":"Specifications","id":"specifications"},{"text":"Browser compatibility","id":"browser_compatibility"}],"baseline":{"baseline":"high","baseline_low_date":"2015-07-29","baseline_high_date":"2018-01-29","support":{"chrome":"1","chrome_android":"18","edge":"12","firefox":"1","firefox_android":"4","safari":"1","safari_ios":"1"}},"browserCompat":["api.Location.search"],"pageType":"web-api-instance-property"}}

    Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

    Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant