By clicking on the X. I want to hide the div
that houses my iFrame. I inserted the iFrame with jQuery. I created a jsFiddle with my example. Right now if I can just get “clicked” into the console when clicking on the X I’ll be happy.
Here is my jQuery that inserts and tries to hid the div that contains my iFrame.
$(document).ready(function(){
if (document.location.pathname === '/account'){
console.log("loaded up");
$('body').append($.parseHTML(frame));
}
$('#fresh-credit-button').on('click', function(){
console.log("clicked");
});
});
I don’t have cross domain issues because I am using an appProxy thru Shopify.
2
Answers
You can do it like this if you already fixed the cross-domain issue.
Get the reference to that iframe:
Then from there do it like this below:
Then attach the onclick event
Hmm… You could try streaming the website from jquery like this:
https://jsfiddle.net/uxc930xr/15/
Unfortunately this can’t run on jsfiddle due to it blocking jquery html from other sources