Closed Bug 12545 Opened 25 years ago Closed 25 years ago

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

Categories

(Core :: DOM: Core & HTML, defect, P3)

x86
All
defect

Tracking

()

VERIFIED DUPLICATE of bug 12559

People

(Reporter: desale, Assigned: vidur)

Details

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
Closed: 25 years ago
Resolution: --- → DUPLICATE
*** This bug has been marked as a duplicate of 12559 ***
Verified.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.