Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Mar 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Add component to pop up window function

    Hi,

    I have a javascript function as well as a javascript embedded directly into HTML. What I have been trying to do is merge one component - winref.focus(); - of the embedded javascript into the function so that I can use it over and over again.

    This winref.focus(); component brings the focus back to the pop up window when a user clicks on a button that triggers the pop up window function.

    __________________________________________
    here is the function


    function openTipsExamples() {
    popupWin = window.open('../EORightElements/Chapter_3_01_TipsExamples.htm',
    'open_window', 'scrollbars,resizable,dependent,width=590,height=400,left=0,top=0')
    }
    ___________________________________________

    Here is the embedded javascript in HTML

    <a href="#" onclick="javascript:winref=window.open('adoptframe.htm','adoptframe','left=20,top=20,width=775,heigh t=575,men ubar=1,status=0,location=0,scrollbars=1,toolbar=1,resizable=1');winref.focus();">Adoptions Listings</a>
    _______________________________________________

    So far I haven't been successful. The embedded javascript in HTML works just fine but I know there is some way to incorporate this into the function.

    If you have any ideas, please advise.

    Thanks,
    Tanya

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Posts
    626
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Are you trying to get rid of the "embedded" javascript? If so try this:
    Code:
    function openTipsExamples(page) {
    popupWin = window.open(page,
    'open_window', 'scrollbars,resizable,dependent,width=590,height=400,left=0,top=0')
    popupWin.focus()
    }
    Then in the link do this:
    Code:
    <a href="javascript:openTipsExamples('adoptframe.htm')">Adoptions Listings</a>

  • #3
    New to the CF scene
    Join Date
    Mar 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This is what I was looking to do. I'll play with the code you gave me.

    Thanks,
    Tanya


  •  

    Posting Permissions

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