Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling perl from javascript 2

Status
Not open for further replies.

iralh

Programmer
Sep 20, 2001
12
0
0
US
Hi,

I am using javascript to open a new (smaller) window. I would like to get the data for the page form perl but haven't had any luck getting the link to work. I tried something simple like <a href=&quot;javascript:newWindow('path to perl script')>blah balh</a> but it is a no go. Any ideas?

thanks,
ira
 
ira,
Code:
newWindow
is not a javascript function. What you need is:
Code:
window.open( url, name, features, replace );
Where:
[ul][li][tt]url[/tt] is an optional string that specifies the URL to be displayed in the new window. In your case, this should be something like [tt]'cgi/myPerl.cgi'[/tt][/li]
[li][tt]name[/tt] is an optional string that specifies a name for the new window. This can be used in subsequent [tt]target[/tt] settings for other links.[/li]
[li][tt]features[/tt] is an optional string that specifies what features the new window should have.[/ld]
[li][tt]replace[/tt] is an optional boolean that specifies if the new URL should add or replace the current entry in the browsing history.[/li]
[/ul]
Hope this helps, cheers Neil s-)
 
thanks neil,

the window.open function worked. I did write the newWindow() function but it didn't work. The only problem I'm having is that when the new window opens the parent window gets wiped and only has [object] printed in the upper left corner. Any ideas?

thanks again,
Ira
 
I'm guessing you are doing something like:
Code:
<some property of parent window> = window.open(....);
The window.open function returns a new Window object (which will be printed as
Code:
[object]
if you did
Code:
alert( window.open( ... ) )
. If you are erroneuosly assigning this object to some property of the parent window, then you might be repalcing the contents of that window. How about showing us the line of code you are using to open the new window?
Cheers, Neil
 
Beautiful.....

Thanks for the help.

Ira
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top