From: lihao on
Hi, guys:

I am not sure if this is doable. In page-1, there is a Javascript
onclick event that invoke an pop-up window(this window opens only when
clicking a button). and now I want to setup a link from page-2 to open
page-1 and directly pop up this window. how can I setup this? I know
there is href="javascript:<some code>" which works on the same
document? Can I do this to an external files.

Many thanks,
lihao
From: Scott Sauyet on
On Jan 29, 12:53 pm, lihao <lihao0...(a)gmail.com> wrote:
> I am not sure if this is doable. In page-1, there is a Javascript
> onclick event that invoke an pop-up window(this window opens only when
> clicking a button). and now I want to setup a link from page-2 to open
> page-1 and directly pop up this window. how can I setup this? I know
> there is href="javascript:<some code>" which works on the same
> document? Can I do this to an external files.

Many browsers will not allow you to pop up a window except in response
to some user action, or have a configuration preference to control
this behavior.

You could pretty easily *try* this, by putting some string, say
"autopop" in the query string for the page, and then on document load
run

if (/autopop/.test(document.location.search)) {
// call your pop-up function here.
}

But it will often fail to load the popup. I think a lot of people
would automatically have such a pop-up blocked. I know I do.

Cheers,

-- Scott