Joe's Blog

line

A blog by Joe Billman about programming, and other stuff

line

The Proper Way of Referencing Elements on a Web Page

Posted on: February 10th, 2010 by Joe

line 3 Comments

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 Responses

  1. WP Themes says:

    Nice post and this enter helped me alot in my college assignement. Thanks you seeking your information.

  2. new moon says:

    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 ๐Ÿ™‚

  3. Joe says:

    new moon,

    I’m just using the default theme.

Leave a Reply


Warning: Use of undefined constant Y - assumed 'Y' (this will throw an Error in a future version of PHP) in /homepages/16/d145171736/htdocs/php/footer.php on line 1