Open popup and execute JavaScript Function

A

aljamala

Hi,

I have a link for an employee directory search page. The link (http://
xxxx/Search.aspx) works fine, however, I have another link to do an
Advanced Find.
From the search page, to do an advanced find, you click a link button
and its href is javascript:SEC38536A_OSA()

What I want to do is, open the search page and call this javascript
function automatically (since I am linking an advanced search)...how
is this possible?


I've tried something like this, but failed:

var newWind = window.open('http://atcit/Search.aspx', 'newWind');
newWind.SEC38536A_OSA();

Thanks in advance
 
S

supremeoppressor

Would an "onload" work?

Hi,

I have a link for an employee directory search page. The link (http://
xxxx/Search.aspx) works fine, however, I have another link to do an
Advanced Find.


and its href is javascript:SEC38536A_OSA()

What I want to do is, open the search page and call this javascript
function automatically (since I am linking an advanced search)...how
is this possible?

I've tried something like this, but failed:

var newWind = window.open('http://atcit/Search.aspx', 'newWind');
newWind.SEC38536A_OSA();

Thanks in advance
 
A

aljamala

I tried this:
win = window.open('http://atcit/Search.aspx', 'new');
win.onload = SEC38536A_OSA();

still no luck

I think the source of the problem is that I am trying to access the
function from a different domain...here is a snippet I found on the
web

It is because of the cross-domain script security restriction (also
referred as the "Same Origin Policy"). A script loaded in a window (or
frame) from a distinct origin (domain name) cannot get nor set
properties of another window (or frame) or the properties of any of
its HTML objects coming from another distinct origin (domain name).
Therefore, before executing a script targeting a secondary window, the
browser in the main window will verify that the secondary window has
the same domain name.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top