javascript - AJAX post from within iFrame to refresh parent page -
i have js function called in iframe performs post server , suppose refresh parent page of iframe. when click button on third party site, hidden div rendered iframe. once make submit post, want refresh page (3rd party) page.
so current setup website (which third party , have no control on code), this:
- body
- div
- div
- div
- table
- tr
- my iframe
- ....
so code attached jquery ajax post call such:
..... xhtml.append("}).done(function() { alert('im here'); window.location.reload(false);});"); xhtml.append("}"); .....
i'd prefer not showing code - can confirm done callback post called correctly , page appear "refresh" - should treating first entered page, iframe closed.
how fresh reload of page/css/etc? figured work, appears doesn't.
--edit--
i realized adding reload(true) reload server on initial request. however, other content renders (to view hidden div) doesn't appear reload correctly. leaves hidden divs up.
--edit 2--
it looks window.location.reload(false); isn't true "replica" of browser refresh call. ideally i'm looking for.
instead of saying window.location.reload
try using window.parent.location.reload
above options work in case of page , contents of iframe both hosted on same domain.
Comments
Post a Comment