Anders Gerner
Anders Gerner

Reputation: 775

Post and redirect iframe in safari from popup using target

I have a problem in Safari trying to post and redirect and iframe from a popup.

Let me explain the flow:

  1. User opens page: x.com
  2. x.com contains an iframe on domain: z.com
  3. User clicks on a button in frame from z.com that opens a popup window
  4. User makes a click in popup window and the pop up window then makes a form with some hidden values, an action, method as post and target as "_parent" (I have tried saying target is the name og the iframe.)
  5. Popup window use self.close();

As you can see i want the popup window to submit a form in the pop up window that redirects the iframe.

This works great in firefox, chrome, IE but not safari. :( IF i open the domain z.com directly in safari and then pop up bla bla bla it works great.

So please.. I have read a thousand questions and answer but no luck.

How can i post a form to an iframe from a pop up window and make sure the iframe redirects to the action from the form.

I dont think i ned to show any code, sinces its a simple form. I use document.forms['iframename'].submit(); to submit my form.

SOLUTION: See comment. :)

Upvotes: 0

Views: 2204

Answers (1)

Anders Gerner
Anders Gerner

Reputation: 775

Solution: Add a submit button to the page, (can be display:none) and then make javascript "click" that submit button.. Guess Safari needs to "simulate" a user click :)

Upvotes: 1

Related Questions