2
나는 다양한하는 HREF 몇 가지 링크를 가지고 같은,이 값에 대한 최종 URL을 얻으려면 : BTW 내가 클릭 처리를위한 코드를 원하지 않는href 값에서 최종적인 URL을 얻는 방법은 무엇입니까?
http://localhost/ -> http://localhost/
localhost -> http://mysite.example/localhost
firstpage -> http://mysite.example/firstpage
/anotherpage -> http://mysite.example/anotherpage
#anchor1 -> http://mysite.example/currentpage#anchor1
/#anchor2 -> http://mysite.example/#anchor2
. 나는 그걸 할 수있어.
순수 js로 풀 수 있습니까? – kbec
확실히 :'element.href'는 전체 URL을 반환하고'element.getAttribute ("href")'는 정의 된대로 속성 값을 반환합니다. – wrock