473,386 Members | 1,830 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Parent window focus problem - iPhone

Hi All,

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
  1. 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>';
  2.  
  3.  
  4. jQuery("#"+this.getLocation()).append(formData);
  5.  
  6.  
  7. 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
  1. jQuery(document).ready(function() {
  2.       ...
  3.       ...
  4.  
  5.         window.close();
  6.  
  7.         window.opener.focus()
  8.     });
====


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
Sep 11 '12 #1
1 3283
acoder
16,027 Expert Mod 8TB
How about closing the child window (login) from the parent (client)? Keep a reference to the opened window, then use it to close the window:
Expand|Select|Wrap|Line Numbers
  1. var loginWin = window.open(...);
  2. ...
  3. // call in a function called from child?
  4. loginWin.close();
  5.  
Sep 17 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Randell D. | last post by:
Folks, I'm working on a contact name/address database whereby a slimed down list is shown in the main window. When a record is selected, the complete record is displayed in a new window via a...
1
by: Barry Svee | last post by:
I'm struggling with the JavaScript blur event. I have an activex control that I need to interact with when a window loses focus, namely to instruct it to give up control of a barcode scanner so...
2
by: Robert Nurse | last post by:
Hi All, I've got a strange problem in IE that I wonder if anyone has seen before. Basically, I've got a two window scenario. The parent window opens the child via window.open(). The child...
4
by: Roger | last post by:
Hi, I am confused about the differences between this.window.focus(), window.focus(), and this.focus(). I want to use the calls in a <body onload="..."tag. What are the differences between...
4
by: John Kotuby | last post by:
Hello all, I am new to Javascript and have been trying to find an answer to this problem. After searching 3 books and searching postings, I am going to ask this newgroup. I am using a pre-built...
1
by: pingalkar | last post by:
Hi, In my application, I call one popup winodow by using this link.. <a href="#" onClick="return showWindow('1','XYZ');"> <img src="images/magnifier.gif" ALT="Chemicals"...
1
by: elizayiu | last post by:
Hi, I need to write a webpage which does the following: - open up a window and pass parameters into it (i.e. need to call showModalDialog() or showModelessDialog()) - contains jscript to...
4
by: Spizzat2 | last post by:
I'm trying to figure out a workaround to a minor annoyance that I'm coming up with while coding a site. I've got some keyboard shortcuts set up for the site via javascript, and when I press escape,...
3
by: Natygan | last post by:
Hi, I've got a Web page which can become a parent window : some links use "window.open" to open the desired link into a new child window. This parent window has got an auto-refresh...
1
by: varunvashishth | last post by:
hi, I'm facing a problem with displaying a child jsp on top of parent jsp. on clicking a link in parent jsp the child jsp opens up and it has some list of values and other textboxes which gets...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.