1

I have a Web Application in which I display some media. I originally had a piece of HTML like

    <video id="video" class="video-player">
        <source src="media/foo.mp4"/>
    </video>

displayed on '/shows/' page.

This absolute URL was translated to '/media/foo.mp4' in Chrome, but Firefox translated it to '/shows/media/foo.mp4'. I know that I can simply solve this problem by putting a / in the beginning of relative URL, but the question is:

What cares should I have when using relative URLs? Are there any other issues concerning cross-browser compatibility?

finiteautomata
  • 3,753
  • 4
  • 31
  • 41
  • 1
    http://stackoverflow.com/questions/2005079/absolute-vs-relative-urls?rq=1 – j08691 Mar 19 '13 at 14:16
  • I have never seen Chrome set the URL to the root... – BenM Mar 19 '13 at 14:24
  • 2
    @BenM - I just ran into this today. It happens when you have a path that doesn't end in a trailing slash: `URL = /path/to/foo`, `src="media/bar"` is processed as `/media/bar`, but if `URL = /path/to/foo/`, then the same src is processed as `/path/to/foo/media/bar` as expected. – beatgammit Jul 20 '13 at 03:58

0 Answers0