[TESTCASE] document.links[num].hash returns undefined.

VERIFIED DUPLICATE of bug 12559

Status

()

defect
P3
normal
VERIFIED DUPLICATE of bug 12559
20 years ago
3 years ago

People

(Reporter: desale, Assigned: vidur)

Tracking

Trunk
x86
All
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Link.hash returns undefined instead of returning anchor name in 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 "Result Text Box", and one button called "Check Link.hash".
4] Click this button.

EXPECTED RESULTS:
After clicking button "Check Link.hash", "Result Text Box" should show
"#angels".

ACTUAL RESULTS:
"Result Text Box" shows "undefined".

CODE:

<HTML>
<HEAD>
<TITLE>Link Test</TITLE>
</HEAD>
<SCRIPT>
<!--
function linkprop(){
document.workform.result.value=document.links[0].hash;
}
//-->
</SCRIPT>
<BODY>
<FORM NAME="workform">
<A HREF="http://www.netscape.com/index.html#angels">Test Link:
http://www.netscape.com/index.html#angels</A><BR>
Result Text Box<INPUT TYPE="text" SIZE="30" NAME="result" VALUE=""><BR>
<INPUT TYPE="button" NAME="but1" VALUE="Check Link.hash"
onClick="linkprop();"><BR><BR>
<H3>Expected Answer: #angels</H3>
</FORM>
</BODY>
</HTML>

END OF CODE:

In testcase I'm simply using document.links[0].hash to get anchor name.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
*** This bug has been marked as a duplicate of 12559 ***
Status: RESOLVED → VERIFIED
Verified.
Verified.
Blocks: MyFirstBug
can you explain me, I got #angels in result text box, but when I run the test case  
for test matrics "JavaScript Object:  Area" for Area001 in yahoo homepage it's
giving "#angels?ser=15" instead of "#angels1" etc. Please explain the difference
of behaviour.
You need to log in before you can comment on or make changes to this bug.