javascript - How to detect close in another domain of iframe? -
my webpage has iframe.
and click button, form submit iframe post method, domain.
<iframe name="iframe" src=""> </iframe> <form name="form" target="iframe" action="another domain" method="post"> ... </form> document.form.submit(); in iframe, domain close window.
how detect that?
i use iframe.contentwindow, iframe.contentwindow.document.head raise error in internet explorer because access denied.
sometime along time ago, possible. these days security on internet has become important can no longer modify inside iframe.
since iframe.contentwindow readonly think trying impossible want. https://developer.mozilla.org/en-us/docs/web/api/htmliframeelement/contentwindow
anyways posting data client side code domain can considered unsafe , might give problems. http/form post unencrypted, , unsafe transmitting personal info, urge use ssl , think send.
Comments
Post a Comment