I’m working on making a mobile version of a website hosted on a GoDaddy Windows server. The way GoDaddy apparently handles a mobile subdomain is by having that webpage be inside a frame. For example:
<head>
</head>
<frameset rows="100%,*" border="0">
<frame src="myurl.com" frameborder="0" />
<frame frameborder="0" noresize />
</frameset>
<!-- pageok -->
<!-- 02 -->
<!-- -->
</html>
The problem is that any link I open in that page opens within the frame and the URL in the address bar never changes. So my question is how can I get the frame URL to show in the browser’s address bar. As far as I know, GoDaddy doesn’t give me access to the file with the above html in it to allow me to alter that. Each page has an initial php script ran to check if it needs to redirect to a mobile browser, so if there is a way to do this with PHP, I can easily implement it.
Thanks for any help you guys can offer.
You can accomplish this using JavaScript on your page:
This effectively “breaks” out of the parent frame by setting the parent frame window location to the location of the current frame.
Of course, you’d want to have some sort of indicator that you just broke out of the frame as to prevent looping:
Hope this helps.