html - Get Frame src URL in address bar -


i'm working on making mobile version of website hosted on godaddy windows server. way godaddy apparently handles mobile subdomain having webpage inside frame. example:

 <head>   </head>  <frameset rows="100%,*" border="0">  <frame src="myurl.com" frameborder="0" />  <frame frameborder="0" noresize />  </frameset>   <!-- pageok -->  <!-- 02 -->  <!-- -->  </html> 

the problem link open in page opens within frame , url in address bar never changes. question how can frame url show in browser's address bar. far know, godaddy doesn't give me access file above html in allow me alter that. each page has initial php script ran check if needs redirect mobile browser, if there way php, can implement it.

thanks guys can offer.

you can accomplish using javascript on page:

top.location.href = document.location.href; 

this "breaks" out of parent frame setting parent frame window location location of current frame.

of course, you'd want have sort of indicator broke out of frame prevent looping:

if (      (document.location.href.indexof("#ibrokeout") == -1) &&      (top.location != location)    ) {      // break out of frame      top.location.href = document.location.href + "#ibrokeout";     } 

hope helps.


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -