Closed Bug 292321 Opened 20 years ago Closed 19 years ago

javascript element.href returns absolute URL, not actual value

Categories

(Firefox :: General, defect)

1.0 Branch
All
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: teun, Unassigned)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.7) Gecko/20050414 Firefox/1.0.3
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.7) Gecko/20050414 Firefox/1.0.3

If the href attribute is requested in javascript on an "a" element, the absolute
URL is returned, not the actual value of the href attribute.

<a href="bar.html" onClick="alert(this.href); return false;">Click me</a>

Reproducible: Always

Steps to Reproduce:
1. Create an HTML document
2. Insert this into the body of the HTML document: <a href="bar.html"
onClick="alert(this.href); return false;">Click me</a>
3. Save the page
4. Open it in a Gecko-based browser
5. Click on the link

Actual Results:  
The alert shows an absolute URL

Expected Results:  
The alert should show the actual value of the href attribute of the "a" element.
Attached file Simple testcase
This is the same testcase asdescribed in the bug.
Product=Rhino has nothing to do with Firefox browser in general or its
JavaScript implementation in particular. Please use proper product next time.
Component: Core → Bookmarks
Product: Rhino → Firefox
Version: other → 1.0 Branch
Product=Rhino has nothing to do with Firefox browser in general or its
JavaScript implementation in particular. Please use proper product next time.
Component: Bookmarks → General
Assignee: igor → nobody
QA Contact: core → general
This is intentional. The fact that the property and the attribute are the same in IE is a bug in IE.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: