Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7887629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:37:46+00:00 2026-06-03T05:37:46+00:00

The browser has a very efficient URL parser that let you get location.href ,

  • 0

The browser has a very efficient URL parser that let you get location.href, hash, query, etc from the current URL. I’d like to use it instead of coding something using regexes.

If you set location.href or do location.replace(url), the page gets redirected in Chrome. I tried to get the prototype of location in this browser, but I can’t find location.prototype. There is a location.__proto__ which is described as the Location class in the js console, but I can’t find a way to instantiate it. Plus, I need a cross browser solution and __proto__ is not available in IE.

If it’s not possible, don’t give me a regex alternative, just tell me the hard truth, provided you can back it up with evidences.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T05:37:48+00:00Added an answer on June 3, 2026 at 5:37 am

    Yes, it’s very much possible! If you create a new a object, you can use the location fields without redirecting the browser.

    For instance:

    var a = document.createElement('a');
    a.href = "http://openid.neosmart.net/mqudsi#fake"
    

    You can now access .hash, .pathname, .host, and all the other location goodies!

    > console.log(a.host);
    openid.neosmart.net
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

IE9 has this ridiculous blue arrow that's rendered any time the browser window has
I have a Delphi application that has a document browser as the main form.
I have a Silverlight 4 out-of-browser application with a ScrollViewer that has several RichTextBoxes
Google chrome has a very nice speech recognition control in it's browser. For example
I am currently updating a webpage that has some very simple data displayed in
ie6 has been bugging me up from a very long time from now. and
We have a very lengthy newsletter that has been designed and developed to look
I have a layout that is working, but it has one very annoying problem..
I created a fixed positioned div that has a very large width so that
I'm currently working on a project that has a very interesting set of requirements.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.