I have a feedback pop up (TickBox) that loads a cross domain iFrame
and when submitting the form it loads the "thanks for...." page.
I want that when user submits the feedback button it should hide the iFrame
wrapper.
I know that because of the "same origin policy" security limitations you cant get the actual location of the iFrame
when it changes.
My question is, can i somehow get the history via history.length
to check if this is a new location?
Or maybe read its content and find the new page text (like: "thanks for") and hide its wrapper
$("iframe").load(function(){
var iframeSrc = $(this).contents()[0].location.hash; /*or history.length */
var isSubmitedUrl = /Home_Landing/
var testUrl = iframeSrc.search(isSubmitedUrl)
if(testUrl >= 0){ /*or if(history.length >= 0)*/
$(".iframeWrap").hide();
}
})