Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

Commit

Permalink
Changed my base tag support test to use an a/href instead of a q elem…
Browse files Browse the repository at this point in the history
…ent w/ cite attribute. Why was I using q anyway, you might ask? Dunno, but it worked fine until Safari just regressed in their q support for cite attributes that respect base hrefs, so... anchor it is!
  • Loading branch information
scottjehl committed Feb 11, 2011
1 parent 9bdd978 commit 83b715e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rwd-images/rwd-images.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
base = (function(){
var backup,
baseAdded = false,
q = doc.createElement("q"),
a = doc.createElement("a"),
supported = false,
base = head.getElementsByTagName("base")[0] || (function(){
baseAdded = true;
Expand All @@ -69,9 +69,9 @@
backup = !baseAdded && base.href;
//test base support before using
base.href = location.protocol + "//" + "x/";
q.cite = "y";
a.href = "y";
//if dynamic base tag is unsupported (Firefox)
if(q.cite.indexOf("x/y") < 0 ){
if( a.href.indexOf("x/y") < 0 ){
if(backup){
base.href = backup;
}
Expand Down

0 comments on commit 83b715e

Please sign in to comment.