亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb

首頁 > 編程 > HTML > 正文

英文:A鏈接標記ie下會自動補全href

2024-08-26 00:09:20
字體:
來源:轉載
供稿:網友

whilst working on the ajax link tracker and mapsurface i have come across an inconsistency in how the href attribute is retrieved using dom scripting.

the href attribute is different to other element attributes in that the value set can be relative to the context of the page url. if you set a link with a relative href attribute

<a href="../development/test1.html">test page</a>

the browser will look at the pages current url and derive an absolute url for the link.

http://www.glenn.jones.net/development/test1.html

this is the root of the problem, some browsers return the text of the attribute and others return the derived absolute url. the results also differ by the method you use to retrieve the href attribute. there are three common ways to access an attribute:

    linkobj.href;    linkobj[‘href’];    linkobj.getattribute(‘href’);

the linkobj.href and linkobj[‘href’]; methods of accessing the attribute consistently return the derived absolute url.

microsoft has tried to address this by problem adding a second parameter to the getattribute method. the second parameter can be set to 0,1 or 2. if the parameter is set to 2 the method returns the attribute text. any other setting will return the derived absolute url.

    linkobj.getattribute(‘href’);    linkobj.getattribute(‘href’,2);
    derived
absolute url
attribute text
ie linkobj.href; x  
ie linkobj.getattribute(‘href’); x  
ie linkobj.getattribute(‘href’,2);   x
gecko linkobj.href; x  
gecko linkobj.getattribute(‘href’);   x
gecko linkobj.getattribute(‘href’,2);   x
opera linkobj.href; x  
opera linkobj.getattribute(‘href’); x  
opera linkobj.getattribute(‘href’,2); x  
get attribute test page test on ie6, firefox 1.5 and opera 8.51.

so what should be returned by the getattribute method? the w3c dom level 2 core specification which sets out the structure of the getattribute method does not cover this issue. it is not that either approach is wrong or right. on this point the specification is open to interpretation.

as a coder i would like to be able to access both values. the dom core specification should be updated to address the problem.

after a really good exchange with jim in the comments below, i stand corrected. the specification does say the getattribute should return the attribute value, not the absolute url. the microsoft approach is wrong.

for the time being i am using the old school object property method linkobj.href to return derived absolute urls. it provides the most consistent results across all browsers.

urls of interest
w3c rec dom level 2 core specification for getattribute
gecko documentation for getattribute
microsoft documentation for getattribute

as usual just as i was finishing this post i found this bug report on the quickmode site which discusses the same subject.
getattribute href is always absolute.html
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb
日韩精品免费视频| 国外日韩电影在线观看| 国产精品免费在线免费| 国产精品99久久久久久久久| 亚洲日本成人网| 最近2019年日本中文免费字幕| 91国产视频在线| 亚洲加勒比久久88色综合| 欧美亚洲国产视频| 97国产真实伦对白精彩视频8| 国产成人精品一区二区三区| 久久久女人电视剧免费播放下载| 国产97色在线|日韩| 亚洲第一国产精品| 日韩美女毛茸茸| 亚洲电影免费观看高清完整版在线| 亚洲图中文字幕| 欧美一级黑人aaaaaaa做受| 亚洲3p在线观看| 久久国产精品免费视频| 久久视频在线观看免费| 成人黄色免费在线观看| 欧美国产日韩精品| 亚洲福利在线视频| 久久久最新网址| 亚洲综合中文字幕在线观看| 少妇高潮 亚洲精品| 国产乱肥老妇国产一区二| 欧美另类在线播放| 久久久成人精品视频| 久久久精品亚洲| 91色中文字幕| 亚洲欧美国产va在线影院| 国产中文字幕91| 久久成人精品电影| 色妞在线综合亚洲欧美| 久久久精品中文字幕| 亚洲天堂av网| 91豆花精品一区| 国产精品∨欧美精品v日韩精品| 国产69精品99久久久久久宅男| 亚洲色在线视频| 538国产精品视频一区二区| 中文字幕亚洲一区二区三区五十路| 国产丝袜精品视频| 91超碰中文字幕久久精品| 亚洲成人国产精品| 亚洲在线观看视频| 在线日韩欧美视频| 在线视频一区二区| 亚洲成人av资源网| 亚洲人成绝费网站色www| 亚洲第一视频网站| 91成人性视频| 国产一区二区激情| 亚洲天堂av在线播放| 国产精品久久久久久久7电影| 黑人巨大精品欧美一区免费视频| 欧美日韩中文字幕综合视频| 亚洲精品999| 亚洲四色影视在线观看| 午夜精品蜜臀一区二区三区免费| 在线观看亚洲区| 热久久免费国产视频| 日本精品一区二区三区在线| 亚洲国语精品自产拍在线观看| 日韩欧美国产骚| 在线日韩日本国产亚洲| 欧美日韩成人在线观看| 欧美性色视频在线| 成人午夜两性视频| 中文字幕在线亚洲| 91在线免费视频| 清纯唯美亚洲激情| 97国产真实伦对白精彩视频8| 精品国产一区二区三区久久狼黑人| 国产午夜精品麻豆| 青草青草久热精品视频在线观看| 4438全国成人免费| 最近日韩中文字幕中文| 欧美精品一区二区免费| 九九热这里只有精品免费看| 日本高清视频一区| 蜜臀久久99精品久久久久久宅男| 精品久久久在线观看| 夜夜嗨av一区二区三区免费区| 亚洲人在线观看| 国产精品久久久久久一区二区| 国产精品高潮呻吟久久av黑人| 午夜精品一区二区三区在线视频| 亚洲一区二区三区香蕉| 国产一区在线播放| 日韩有码视频在线| 精品人伦一区二区三区蜜桃网站| 国产xxx69麻豆国语对白| 亚洲精品国产精品国自产在线| 久久久久久久久久久久av| 亚洲已满18点击进入在线看片| 欧美日韩一区二区三区| 亚洲精品mp4| 91亚洲精品一区二区| 久久久久久999| 久久久亚洲精选| 亚洲国产精品人人爽夜夜爽| 日韩中文在线中文网在线观看| 这里只有精品在线观看| 97涩涩爰在线观看亚洲| 欧美亚洲另类视频| 久久久在线观看| 国产成人精品视频在线观看| 91产国在线观看动作片喷水| 欧美极品美女电影一区| 国产盗摄xxxx视频xxx69| 亚洲精选一区二区| 性色av香蕉一区二区| 亚洲国产成人久久| 97av在线播放| 日本欧美一二三区| 日韩欧美成人免费视频| 日韩av最新在线观看| 亚洲成人网在线| 国内外成人免费激情在线视频网站| 91av国产在线| 欧美日韩国产第一页| 亚洲国产精品久久久久秋霞蜜臀| 久久久久久com| 亚洲激情免费观看| 亚洲精品v天堂中文字幕| 日本一区二区三区在线播放| 亚洲国产91色在线| 亚洲欧美成人网| 一本一本久久a久久精品牛牛影视| 亚洲欧美国产精品专区久久| 国产美女被下药99| 国产视频观看一区| 日本韩国在线不卡| 国产欧美日韩中文字幕在线| 欧美性xxxxx极品| 91网站免费观看| 久久av在线看| 国产精品人人做人人爽| 久久精品一区中文字幕| 色www亚洲国产张柏芝| 538国产精品一区二区免费视频| 日韩久久免费电影| 欧美大片第1页| 2019中文字幕在线| 97成人在线视频| 日韩成人在线观看| 欧美高清无遮挡| 国产日韩精品入口| 日本aⅴ大伊香蕉精品视频| 欧美午夜性色大片在线观看| 精品亚洲一区二区| 久久精品国产欧美亚洲人人爽| 91精品国产色综合| 一区二区三区国产视频| 最新国产精品拍自在线播放| 亚洲a级在线观看| 55夜色66夜色国产精品视频| 亚洲欧美日韩图片| 国产欧美精品一区二区三区介绍| 热久久免费视频精品| 欧美日韩一区二区在线播放|