A标记的href, uri
A锚记标签的href可以是任何合法uri,uri的定义见http://www.ietf.org/rfc/rfc2396.txt
这就是说不局限于
相对路径 ../ , #,#id
javascript://
ftp://ftp.is.co.za/rfc/rfc1808.txt
-- ftp scheme for File Transfer Protocol services
gopher://spinaltap.micro.umn.edu/00/Weather/California/Los%20Angeles
-- gopher scheme for Gopher and Gopher+ Protocol services
http://www.math.uio.no/faq/compression-faq/part1.html
-- http scheme for Hypertext Transfer Protocol services
mailto:mduerst@ifi.unizh.ch
-- mailto scheme for electronic mail addresses
news:comp.infosystems.www.servers.unix
-- news scheme for USENET news groups and articles
telnet://melvyl.ucop.edu/
-- telnet scheme for interactive services via the TELNET Protocol依据w3c规范,如下标签A, APPLET, FORM, FRAME, IFRAME, IMG, MAP的id和name都可作为锚记名(如果同一标签同时设置id和name,则应保持一致),所有标签都支持id为锚记http://www.w3.org/TR/html401/struct/links.html 。
看下列锚记:
href=”?” 在原url后加上?(如果有?则清除原?后面的参数),这其实就是相对原路径添加个空参数,无意义的用法,而且会导致刷页面。
href=”#el_id”本页面锚记
href=”javascript://”本页面空锚记,不会跳到顶部,但是IE下会触发beforeunload事件,见http://blog.ureshika.com/archives/201.html
href=”javascript:void(0)” 本页面空锚记,不会跳到顶部,但是IE下会触发beforeunload事件,见http://blog.ureshika.com/archives/201.html
href=”##”本页面空锚记,不会跳到顶部,不会触发beforeunload事件
href=”#”本页面锚记,会跳到顶部,不会触发beforeunload事件
href=”###” 同###
href=”../” 相对路径

