Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><a href="http://www.w3schools.com/TAGS/tag_base.asp" rel="nofollow noreferrer">http://www.w3schools.com/TAGS/tag_base.asp</a></p> <p>the base tag has two components href and target. Yours seems to be fine. coold you give some example of the links on which it is failing?</p> <p>see <a href="http://ashita.org/StackOverflow/base_test.html" rel="nofollow noreferrer">http://ashita.org/StackOverflow/base_test.html</a> for a demonstration. (my test)</p> <p>Edit: see comments</p> <pre><code>function addBase(url) { var regex = /^(https?|ftp):\/\//; var a = Array.prototype.slice.call(document.getElementsByTagName('a'),0); var link = Array.prototype.slice.call(document.getElementsByTagName('link'),0); var script = Array.prototype.slice.call(document.getElementsByTagName('script'),0); var img = Array.prototype.slice.call(document.getElementsByTagName('img'),0); var hrefs = a.concat(link); var srcs = img.concat(script); var element,href,src; for (var i=0,len=hrefs.length;i&lt;len;++i) { element = hrefs[i]; href = element.getAttribute("href"); if (href) { if (!regex.test(href)) { href = (url + "/" + href).replace("//","/"); //to handle double slash collision element.setAttribute("href",href); } } } for (var i=0,len=srcs.length;i&lt;len;++i) { element = srcs[i]; src = element.getAttribute("src"); if (src) { if (!regex.test(src)) { src = (url + "/" + src).replace("//","/"); //to handle double slash collision element.setAttribute("src",src); } } } } </code></pre> <p>Tested and working in firefox</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload