473,387 Members | 1,353 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Run popup function from parent

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

Feb 1 '07 #1
5 2138
Daz
On Feb 1, 6:28 pm, aljam...@gmail.com wrote:
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()
I'd recommend against that. What if the user can't use JavaScript, or
doesn't want to? It's often best to use the href attribute to link to
an HTML page, and use onclick to carry out a JavaScript function and
return false to prevent the browser from following the link if
JavaScript is enabled.
>
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 don't think I understand you correctly. Is it possible for you to
post an example?
>
I've tried something like this, but failed:

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

Thanks in advance

Feb 1 '07 #2
Daz
On Feb 1, 6:28 pm, aljam...@gmail.com wrote:
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

Another thing that has just occurred to me, is that you might be
calling on the function before the window has fully loaded? I'm not
entirely sure if I am correct however, but you might want to look into
getting the child window to report to the parent when it's completely
loaded, before calling on the functions within it.

Feb 1 '07 #3
On Feb 1, 2:27 pm, "Daz" <cutenfu...@gmail.comwrote:
From the search page, to do an advanced find, you click a link button
and its href is javascript:SEC38536A_OSA()

I'd recommend against that. What if the user can't use JavaScript, or
doesn't want to? It's often best to use the href attribute to link to
an HTML page, and use onclick to carry out a JavaScript function and
return false to prevent the browser from following the link if
JavaScript is enabled.
I agree with you there, since 10-15% of users do disable JavaScript.
However, this is an intranet site, and we all use JavaScript so that
is not a worry.
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 don't think I understand you correctly. Is it possible for you to
post an example?
Sure...

Say I have two pages...parent.html and child.html

here is the parent:
<html>
<head>
<title>parent</title>
<script language="JavaScript">
var win;

function popup()
{
win = window.open("child.html", "test");
win.popup2();
}
</script>
</head>
<body>
<input type='button' value='parent click' onclick='popup()'>
</body>
</html>

here is the child:
<html>
<head>
<title>child</title>
<script language="JavaScript">
function popup2()
{
alert('true');
}
</script>
</head>
<body>
<input type='button' value='child click' onclick='popup2()'>
</body>
</html>
Basically I want to call open the child and call popup2 [in the child]
from the parent in one click.

Feb 1 '07 #4
On Feb 1, 2:33 pm, "Daz" <cutenfu...@gmail.comwrote:
Another thing that has just occurred to me, is that you might be
calling on the function before the window has fully loaded? I'm not
entirely sure if I am correct however, but you might want to look into
getting the child window to report to the parent when it's completely
loaded, before calling on the functions within it.- Hide quoted text -
although I don't think that this is the problem, I think you were
heading in the right direction...I am actually not able to access the
JavaScript function (in http://atcit/Search.aspx) because I am calling
it from a different domain (http://efinfonet) which induces the cross-
domain script security restriction.
Feb 1 '07 #5
Daz
On Feb 1, 9:15 pm, aljam...@gmail.com wrote:
On Feb 1, 2:33 pm, "Daz" <cutenfu...@gmail.comwrote:
Another thing that has just occurred to me, is that you might be
calling on the function before the window has fully loaded? I'm not
entirely sure if I am correct however, but you might want to look into
getting the child window to report to the parent when it's completely
loaded, before calling on the functions within it.- Hide quoted text -

although I don't think that this is the problem, I think you were
heading in the right direction...I am actually not able to access the
JavaScript function (inhttp://atcit/Search.aspx) because I am calling
it from a different domain (http://efinfonet) which induces the cross-
domain script security restriction.

Aaah. That had occured to me, but I convinced myself that you would be
trying to access it from the same domain. There are lots of tutorials
around which show you how to use remote scripting to access data from
another website using hidden frames/iframes. I am not entirely sure if
this will help you with regards to accessing the script, however.

Feb 2 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

38
by: Shaun McKinnon | last post by:
HI...Here's my problem...I have a popup window that loads when i want it to, but it's not sized properly. I've set the size, but it doesn't seem to work. I've been on 8 different websites to find...
2
by: Al Clare | last post by:
Hello, I am currently having problems with Popup windows in an application I am writing. I have a page, which opens a Popup window to a Perl Script on another server. Because of this, I cant...
1
by: Bill H | last post by:
I run a dbms application that interfaces with the web. This module creates a frames page with two frames ('main' and 'mwinfoframe'). All communication with the dbms is routed through the...
4
by: Davey | last post by:
I have a website which has a popup window (this only opens when the user chooses to open it). In the popup window I have a <select> control which lists a selection of "classes". Each class has a...
4
by: Earl Teigrob | last post by:
I am thinking about using a popup window to edit settings that will affect parent asp.net page. The data that is changed in the popup window will be saved to the datastore that is loaded and...
1
by: Earl Teigrob | last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at...
15
by: H00ner | last post by:
Hello All Hope you can help Been pulling my hair out about a popup problem in ASP.NET. One of the forms i wrote requires the user to select a product from a list in a popup web form. the...
5
by: midnight_use_only | last post by:
hi all, quick question, how do you submit a form to a parent window from a child popup window? i have the following and all online documentation *suggests* that it should work but it does NOT: ...
2
by: sangram | last post by:
i need a javascript for popup window and how to pass value to that new window from old window .
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.