• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 4. Blazing Browsers: Real World ... > Previewing Root-Relative Links Local...

Previewing Root-Relative Links Locally

Did you know that Dreamweaver manages a little slight of hand that makes it possible to preview pages with site-root-relative links (up to a point, anyway)? As I’m sure you know, document-relative links preview just fine in Dreamweaver. Dreamweaver creates the temporary file it actually sends to the browser in the same folder as the current page being previewed—so, document-relative links are a snap. Site-root-relative links are a different story, however. Let’s say that you’re working on a page that is saved in a folder three levels deep in your site and you have an <img> tag with a src set to /assets/images/logo.gif. How does Dreamweaver’s Preview in Browser (which is just working with the local file system, not an actual HTTP-type URL) know where to get the image? If you look at the source when previewing, you’ll see that Dreamweaver actually converts the site-root-relative link to a document-relative one. This means that the image src in this example would become ../../assets/images/logo.gif. This works swell for the first page, but if you want to check links from that page, you’re better off previewing through a server—either locally or remotely. Why? Dreamweaver’s bit of legerdemain extends only to the first page previewed; any site-root-relative links on a second page go untranslated.

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint