Results 1 to 2 of 2

Thread: [OT mostly] any ideas why window.opener not firing in my code (fine in sample app)?

  1. #1
    Join Date
    Sep 2007
    Posts
    138

    Default [OT mostly] any ideas why window.opener not firing in my code (fine in sample app)?

    First of thanks for the spring social popup example code. It's excellent.

    I currently have some, what appears to be identical type of code, but the window.opener portion of the javascript never fires so the popup window never closes after the connect completes. Driving me nuts. Just throwing this out there to see if others have some ideas what could be causing it not to fire. I'm guessing there is some other javascript library interfering (but that'll take me some to track down if that's the case.) The form submits to the popup up window perfectly, yet you'll never see the window.opener alert fire.

    Code:
    <script>
    if(window.opener) {
    	alert("yes if window.opener fires NEVER DOES!!!");
    	window.opener.location.reload(false);
    	window.close();
    }
    </script>
    
    <c:url value="/social/connect/facebook" var="connectUrl"/>
    <form action="${connectUrl}" method="POST" id="socialConnectForm">
        <input type="hidden" name="scope" value="publish_stream,offline_access,....{removed rest for brevity}" />
        <button id="fbConnect" type="submit">Connect</button>
    </form>
    
    <script>
    j$(document).ready(function() {
            j$("#fbConnect").click(function(event){
    		event.preventDefault();
    		window.open("", "connectWindow", "width=600,height=400");
    		var cTP = j$(event.currentTarget).parent();		
    		cTP[0].setAttribute("target", "connectWindow");
    		cTP[0].submit();
    	}); 
    });
    </script>
    My preconnect in my FacebookConnectedInterceptor also fires and does the following:

    parameters.set("display", "popup");

  2. #2
    Join Date
    Sep 2007
    Posts
    138

    Default

    Doh. Stupid moron I am.

    I didn't even pay attention that my connect wasn't returning to the same page and I didn't have that window.opener js code on the page I was returning to.

    Blah. Anyway, maybe someone else will screw up and forget that also so it's here for reference

Posting Permissions

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