Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Using Base Tag with Local Files IE8 and Modern Browser DEMO

By: a guest on Jul 9th, 2012  |  syntax: HTML  |  size: 1.16 KB  |  views: 45  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5.   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6.   <title>Using Base Tag with Local Files IE8 and Modern Browser DEMO</title>
  7.  
  8.   <!-- The name of this file is:  test.html  -->
  9.   <!-- The location of this HTML file on the hard drive is:  C:\temp\html\test.html  -->
  10.  
  11.   <!-- This unusually constructed Base attribute tag uses two rules to have it work for Locally Hosted IE8 Files that are not server based. -->
  12.   <!-- First, the "URL Scheme" is based on "Network Path Reference" which means no Protocol is used. -->
  13.   <!-- Second, the "forward slashes" are changed to "back slashes". It's the syntax IE8 actually expects. -->
  14.   <!-- This entire method is also friendly for modern browsers showing these local files that are not server based. -->
  15.   <base href="\\c:\temp\resources\" />
  16.  
  17. </head>
  18. <body>
  19.  
  20.   <p>
  21.     <!-- The location of this "image.jpg" on the hard drive is at:  C:\temp\resources\image.jpg  -->
  22.     <img src="image.jpg" alt="image" />
  23.   </p>
  24.  
  25. </body>
  26. </html>
clone this paste RAW Paste Data