window.opener.location.href issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Vexander
    New Member
    • Mar 2008
    • 1

    window.opener.location.href issue

    Hi I am trying to right a script that closes a popup and then refreshes the pener to specific URL

    If have this that works form me

    <script type="text/javascript">
    window.opener.l ocation.href = 'http://localhost/fmsuite/Sales/Document.asp? docNumber=' + <%=Request.Quer yString("docNum ber")%>;
    window.opener.f ocus();
    self.close()
    </script>

    But when I change that to this
    <script type="text/javascript">
    window.opener.l ocation.href = 'http://localhost/fmsuite/Sales/Document.asp?do cNumber=' + <%=Request.Quer yString("docNum ber")%> + 'strDocumentTyp e=' + <%=strDocumentT ype%>;
    window.opener.f ocus();
    self.close()
    </script>
    Or
    <script type="text/javascript">
    window.opener.l ocation.href = 'http://localhost/fmsuite/Sales/Document.asp?do cNumber=' + <%=Request.Quer yString("docNum ber")%> + 'strDocumentTyp e=' + <%=Request.Quer yString("strDoc umentType")%>;
    window.opener.f ocus();
    self.close()
    </script>

    I get nothing. I click the add button and noting happens. I am not even sure how to display the href value to troubelshoot.

    I am totally new to java and this is the only time I have used it in my sites so it is probably something stupid so please if you can help ASAP please.

    Thanx
  • hidash
    New Member
    • Mar 2008
    • 7

    #2
    Originally posted by Vexander
    Hi I am trying to right a script that closes a popup and then refreshes the pener to specific URL

    If have this that works form me

    <script type="text/javascript">
    window.opener.l ocation.href = 'http://localhost/fmsuite/Sales/Document.asp? docNumber=' + <%=Request.Quer yString("docNum ber")%>;
    window.opener.f ocus();
    self.close()
    </script>

    But when I change that to this
    <script type="text/javascript">
    window.opener.l ocation.href = 'http://localhost/fmsuite/Sales/Document.asp?do cNumber=' + <%=Request.Quer yString("docNum ber")%> + 'strDocumentTyp e=' + <%=strDocumentT ype%>;
    window.opener.f ocus();
    self.close()
    </script>
    Or
    <script type="text/javascript">
    window.opener.l ocation.href = 'http://localhost/fmsuite/Sales/Document.asp?do cNumber=' + <%=Request.Quer yString("docNum ber")%> + 'strDocumentTyp e=' + <%=Request.Quer yString("strDoc umentType")%>;
    window.opener.f ocus();
    self.close()
    </script>

    I get nothing. I click the add button and noting happens. I am not even sure how to display the href value to troubelshoot.

    I am totally new to java and this is the only time I have used it in my sites so it is probably something stupid so please if you can help ASAP please.

    Thanx

    hi,,

    use
    document.locati on.href="";
    you can open a new window and u can close this by using self.close();

    Comment

    Working...