I'm having trouble in getting the exact value of href only |
It's a little known (maybe) fact that most browsers convert Anchor node elements into Location objects as well. So you can access all parts available to Location too; |
Suppose consider below html code: |
<body> HELLO '59 IS PRESENT <a href="test2.html">HI</a> <a href="https://stackoverflow.com/questions/domain">Another LINK</a> </body> |
In above html, two link exists, one for self domain and another for stackoverflow, now if I look through them, below output would be generated: |
PROTOCOL=http:, HOST=localhost, PORT= LINK PATH=/test2.html PROTOCOL=https:, HOST=stackoverflow.com, PORT= LINK PATH=/questions/domain |
Pages
▼
No comments:
Post a Comment