I am having a peculiar problem with a website i am developing. The problem *only* happens on the iPhone(safari).
My setup is as follows.
1) I have a CLIENT page - shows an initial page, and has a login button.
2) User clicks on the LOGIN button, and is shown a LOGIN popup/new-window (this is created by posting a form using jquery 'submit' function with target='_blank')
====
CLIENT.html
Expand|Select|Wrap|Line Numbers
- var formData = '<form style="display: none; margin: 0; padding: 0; border-width: 0; overflow: hidden;" id="MyFormId" action="https://MYSERVER.COM/v2/widgets" method="POST" target="_blank"><input type="hidden" name="action" value="connect"/><input type="hidden" name="referringURL" value="http://MYCLIENT.com/ClientPage.html"/><input type="hidden" name="cartOwnerId" value="A2R6QUFKT17A1O"/></form>';
- jQuery("#"+this.getLocation()).append(formData);
- jQuery("#"+formIdName).submit();
3) User enters credentials on LOGIN window, and submits. A call is made to the SERVER to authenticate. On SUCCESSFUL authentication, we want to
* CLOSE the LOGIN window
* REDIRECT Client page to new URL
4) Everything works as planned, EXCEPT that the Client window (that created the LOGIN popup/new window), does not return to full-screen (after the LOGIN window closed).
If i try to put a window.opener.focus() in the LOGIN page javascript, i get focus on the CLIENT page, but the LOGIN page does not close(even if i put window.close before the window.opener.focus())
====
LOGIN html
Expand|Select|Wrap|Line Numbers
- jQuery(document).ready(function() {
- ...
- ...
- window.close();
- window.opener.focus()
- });
Is there any tips on how i can close the LOGIN window, and redirect the client page to a new URL, and make the Client window full screen?
Any tips would be appreciated.
Thanks