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 6092273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:25:24+00:00 2026-05-23T12:25:24+00:00

The same URL can be represented in many different representations. e.g. Assuming the browser’s

  • 0

The same URL can be represented in many different representations.
e.g. Assuming the browser’s currently loaded page ishttp://www.example.com/about.html

The following URLs can be considered equivalent from the browser’s point of view:

  • http://www.example.com/contact-us.html and http://www.example.com/contact-us.html
  • http://www.example.com/contact-us.html and contact-us.html
  • http://www.example.com/contact-us.html and .
  • http://www.example.com/contact-us.html and /contact-us.html

With this in mind, is there an easy way to determine this equivalence using JavaScript?

Or, is there a way of obtaining a canonical form of a URL such that the canonical forms can be compared as a way of reaching the answer?

  • 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-05-23T12:25:25+00:00Added an answer on May 23, 2026 at 12:25 pm

    I’ve noticed that when you read an href from an <a href="xxx"> tag via javascript tagObj.href, you always get a fully qualified URL. So, one possibility for your question is to create a hidden <a href="xxx" style="display: none;"> tag, set whatever test URL into it that you want and then read it back. You will get what the browser thinks the fully qualified URL is for that, whether it’s “.”, “index.html” or anything else. You can then compare two fully qualified URLs to each other.

    Here’s an example: http://jsfiddle.net/jfriend00/M7mNF/ that shows how it makes a fully qualified URL out of anything.

    I can’t promise that it does this in every browser, but I’ve never seen any other behavior.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Assuming you have only the URL to a file (hosted on the same server
Our page loads two external pages (same url) using $(#div1).load(mypageurl) & $(#div2).load(mypageurl). Each div
how to read next page of the same URL the URL of the page
Can I use the same URL for both 'Canvas URL' and 'Secure Canvas URL'
Is it considered bad practice to have multiple views for same URL in MVC,
Same question , different langauge. How do you do it in Java? Do you
Using the same sort command with the same input produces different results on different
Short version: How can I get the URL of the server my MVC3 project
I'm able to open a url scheme with my apps. However i can have
TLDR I need to change a javascript variable on the same page after clicking

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.