The Proper Way of Referencing Elements on a Web Page

I was recently working on a web page that was not displaying some Flash elements properly on some people’s browsers or so I thought. After beating my head for a bit I realized what the problem was. The .swf file that I was referencing had an absolute path that included the “www.” in the URL. Here is an example: “<param name=”movie” value=”http://www.mywebsite.com/swfs/my_movie.swf” />. The problem was when someone went to the site and did not include the “www” for example: “http://mywebsite.com”. The solution to this is rather simple and should be the practice you use when referencing elements on your pages. It’s called root referencing and here is an example: “<param name=”movie” value=”/swfs/my_movie.swf” />. You leave off the “http://”,ย the “www” and the site name and instead just put a “/” at the beginning. This will work in all cases even if the page that is referencing the element is nested multiple folders deep.

3 thoughts on “The Proper Way of Referencing Elements on a Web Page”

  1. hi there super little blogging site you have there ๐Ÿ™‚ I apply the exact web theme on my own website although for whichever explanation it appears to stream more quickly on this site despite the fact that this site contains way more content. Are you working with any sort of plug ins or widgets that will quicken it up? Do you think you might be able to show the widgets so I would be able to use them in my personal web pages so twilight eclipse users could watch twilight new moon online trailers and clips more rapidly I’d personally always be pleased – many thanks in advance ๐Ÿ™‚

Leave a Reply

Your email address will not be published. Required fields are marked *