Ahmed
Ahmed

Reputation: 1

How to Reload a page from Iframe?

Iam just using an iframe for login and register. and i need to reload the page when the message appears that he successfully registered/logged-in.

for example the iframe would be

when he click login in the iframe it reload other page called "login_success" this page send message"successfully logged in".

Now is the proplem i need the browser reload the page so that the session work in the page that loads the Iframe.

Thanks for responding.

Upvotes: 0

Views: 144

Answers (2)

Piyush
Piyush

Reputation: 4007

You can use following script.

window.parent.location.reload();

Upvotes: 4

Wazan
Wazan

Reputation: 539

Here it is

document.getElementById('ifarme_id').contentWindow.location.reload();

If it is in same domain you can try below

var myframe = document.getElementById('Ifrme_id');
myframe.src = myframe.src;

Upvotes: 0

Related Questions