SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast Aquis's Avatar
    Join Date
    Jun 2006
    Location
    Uttoxeter, Staffordshire, UK
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Sending Variable to Popup

    Hello,

    I'm using a general function to open popups;
    Code:
    function popUp(location,width,height) {
    	if (width == null || width == 0) {
    		width = screen.width / 2;
    	}
    	if (height == null || height == 0) {
    		height = screen.height / 2;
    	}
    	var left = (screen.width / 2) - (width / 2);
    	var top = (screen.height / 2) - (height / 2);
    	wins += 1;
    	var theWin = window.open(location,"window_" + (wins - 1),"width=" + width + ",height=" + height + ",left=" + left + ",top=" + top + ",location=no,directories=no,fullscreen=no,menubar=no,resizable=no,scrollbars=yes,status=no,titlebar=yes,toolbar=no");
    	theWin.is_popUp = true;
    	theWin.window_opener = window;
    }
    In one of the opened windows, I need to use the window_opener variable (declared in the last line of code) - however, it's not working in Safari. It is working in FireFox and Opera, but Safari complains the variable is not set. Is there any other way of sending the value to Safari - or is there an error anywhere?

    Thanks,
    Aquis

  2. #2
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why can't you just use window.opener in the popup? Why do you need window_opener?
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.

  3. #3
    SitePoint Enthusiast Aquis's Avatar
    Join Date
    Jun 2006
    Location
    Uttoxeter, Staffordshire, UK
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well it's just a variable name...in fact, I did use opener originally but it was highlighted to tell me it was a recognised word - I didn't want to put in any potential problems. Changing the variable does not solve the problem.

    Aquis


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •