View Full Version : www. versus no www. affects calling a function?

07-09-2006, 10:27 PM
i have a function that changes the colors of some items in my css code on my page. there's a bunch of colored boxes, you click one to choose the color you want, it can be seen here: www.hollywoodlightweights.com

i also have inline frames on the page and in order for the function to work on the frame at the same time, i put the function code in the frame page as well, and have the parent function also call the frames function, it works fine. BUT if you go to hollywoodlightweights.com without the www. - it doens't work! the iframe function doesn't get called..

i am so stumped as to why... is there any way around this?


Oh and you have to click the bird to enter the page and actually see the function work.. if you click the colored boxes on the intro part, it just changes the color of the page before you actually see the page...

07-10-2006, 03:42 PM
At first I thought it was a cross-domain issue, but then I tried the site out an it works for me.

Anyways, browsers may see yourdomain.com as a completely different website than www.yourdomain.com. In your <iframe> tag set the src equal to /yourpage.html instead of http://www.yourdomain.com/yourpage.html. That way it will keep the same domain instead of referring to it absolutely.

07-10-2006, 09:22 PM
oh my i feel stupid.. derrr.. I thought I already had as /mypage instead of http://www.domain.com/page - as I always do it that way so that a website can be moved without links having to be updated, but then I remembered I changed it to the whole address so that the site would work when viewed off of my hard drive, for easier editing.. oops... anyway, that fixed it, thanks!