Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap

Q1440 Is there anyway to dynamically set the BASE HREF to something if the page is loaded locally and somewhere else is loaded from online?

You are here: irt.org | FAQ | JavaScript | Link | Q1440 [ previous next ]

No. Even trying the following does not work, as Netscape Navigator adds another BASE tag before our own:

<script language="JavaScript"><!--
if (location.protocol == 'file:')
  document.write('<BASE HREF="file:///c:/mymaindir/subir">');
  document.write('<BASE HREF="http://something.com">');

©2018 Martin Webb