Created
July 1, 2013 07:55
-
-
Save susanahernandezd/5899070 to your computer and use it in GitHub Desktop.
Know parent URL of iframe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).live('click', '#cupon_danet3D', function(event){ | |
var re = /(.*)danet(.*)/g, | |
//url = document.referrer, | |
url = document.location.ancestorOrigins[0], | |
matched = url.match(re); | |
if(matched){ | |
event.preventDefault(); | |
var urlCupon = $('#cupon_danet3D').attr('href'), | |
paramDanet = '?utm_source=Danetiframe&utm_medium=Banner_Cupon&utm_campaign=Imprime_Cupon_Productos'; | |
window.open(urlCupon+paramDanet); | |
} | |
//console.log('HEI: '+matched); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment