How can I check the url outside of frame?

How can I check the url outside of frame?

Hi guys,

I'm trying to manipulate my content with jquery based on the URL.

The script works as it should on desktop.  But I'm having a problem with mobile app or mobile site, it doesn't capture the correct URL because the content is in iFrame. The problem is that the iFrame doesn't contain the content I'm after...

Any one can advice the way I could make it work?

Here is what I'm talking about:



This is the script I'm executing:
  1. jQuery(document).ready(function(){
  2.     if (document.URL.indexOf("ebay.co.uk") != -1) { 
  3.       jQuery(".banner").html('<a href="http://stores.ebay.co.uk/rcgorilla"><img src="http://www.rcgorilla.com/ebay/images/banner-uk.jpg"></a>').addClass('no-style');
  4.     } else
  5.     if (document.URL.indexOf("ebay.de") != -1) { 
  6.       jQuery(".banner").html('<a href="http://stores.ebay.de/rcgorilla"><img src="http://www.rcgorilla.com/ebay/images/banner-de.jpg"></a>').addClass('no-style');
  7.     } else
  8.     if (document.URL.indexOf("ebay.fr") != -1) { 
  9.       jQuery(".banner").html('<a href="http://stores.ebay.fr/rcgorilla"><img src="http://www.rcgorilla.com/ebay/images/banner-fr.jpg"></a>').addClass('no-style');
  10.     } else 
  11.     if (document.URL.indexOf("ebay.it") != -1) { 
  12.       jQuery(".banner").html('<a href="http://stores.ebay.it/rcgorilla"><img src="http://www.rcgorilla.com/ebay/images/banner-it.jpg"></a>').addClass('no-style');
  13.     }
  14. });

Thanks guys,