[TESTCASE] document.links[num].host and document.links[num].hostname return undefined.

VERIFIED DUPLICATE of bug 12559

Status

()

P3
normal
VERIFIED DUPLICATE of bug 12559
19 years ago
2 years ago

People

(Reporter: desale, Assigned: vidur)

Tracking

Trunk
x86
All
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

19 years ago
Link.host and Link.hostname returns undefined instead of returning host:port
portion or IP address or host and domain name of URL

BUILDS:
08-24-13 [M9] [Apprunner/Viewer]
08-24-09 [M10] [Apprunner/Viewer]

STEPS TO REPRODECE:

1] Please copy HTML code I'm providing. Save it as HTML file.
2] Open this file with Apprunner/Viewer.
3] You'll see one button called "Check Link.host and Link.hostname".
4] Click this button.

EXPECTED RESULTS:
Two text boxes should show "www.netscape.com"

ACTUAL RESULTS:
Both text boxes show "undefined".

CODE:

<HTML>
<HEAD>
<TITLE>Link Test</TITLE>
</HEAD>
<SCRIPT>
<!--
function linkprop(){
document.workform.result.value=document.links[0].host;
document.workform.result1.value=document.links[0].hostname;
}
//-->
</SCRIPT>
<BODY>
<FORM NAME="workform">
<A HREF="http://www.netscape.com">Test Link: http://www.netscape.com</A><BR>
Link.host    :<INPUT TYPE="text" SIZE="30" NAME="result" VALUE="">
Link.hostname:<INPUT TYPE="text" SIZE="30" NAME="result1" VALUE=""><BR>
<INPUT TYPE="button" NAME="but1" VALUE="Check Link.host and Link.hostname"
onClick="linkprop();">
<INPUT TYPE="reset" NAME="res1" VALUE="Reset"><BR><BR>
<H3>Expected Answers:<BR>
Link.host    :www.netscape.com<BR>
Link.hostname:www.netscape.com</H3>
</FORM>
</BODY>
</HTML>

END OF CODE:

In testcase I'm simply using document.links[0].host and
document.links[0].hostname.
Status: NEW → RESOLVED
Last Resolved: 19 years ago
Resolution: --- → DUPLICATE
*** This bug has been marked as a duplicate of 12559 ***
(Reporter)

Comment 2

19 years ago
Verified.
(Reporter)

Updated

19 years ago
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.