View Full Version : Add component to pop up window function

03-04-2005, 03:27 PM

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,height=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.


03-04-2005, 05:41 PM
Are you trying to get rid of the "embedded" javascript? If so try this:

function openTipsExamples(page) {
popupWin = window.open(page,
'open_window', 'scrollbars,resizable,dependent,width=590,height=400,left=0,top=0')

Then in the link do this:

<a href="javascript:openTipsExamples('adoptframe.htm')">Adoptions Listings</a>

03-04-2005, 08:12 PM
This is what I was looking to do. I'll play with the code you gave me.


EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum