RetroCoder
RetroCoder

Reputation: 2685

How do I remove all frames from current windows in jQuery?

Before posting to another page from my center frame, I want to remove the top and bottom frames so that I don't see my spinner or footer show up in the page I'm posting to.

Can I use something like this?:

jQuery("#frmHeader").remove();
jQuery("#frmFooter").remove();

I don't want to remove the body frame b/c I am posting from that frame to Login Page.

Upvotes: 0

Views: 1578

Answers (2)

Emre Erkan
Emre Erkan

Reputation: 8482

If you don't want any other frame you can set target property of your form to _top.

<form method="post" action="/login/" target="_top">

If you're redirecting user with a link you can use target attribute too.

<a href="/login/" target="_top">Login</a>

Upvotes: 1

stevemanuel
stevemanuel

Reputation: 320

You can use .remove() to pull those frames out, but it will likely disrupt the layout of your page. Is the entire page updating after your post completes or only your body frame?

Upvotes: 1

Related Questions