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.
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: ”. 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: ”. 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.