I am developing an intranet application, in which, in some pages, when the user selects an option, I am using a pop-up window to retrieve the data and displaying it in the main page. The pop-up opens, fetches data, puts in main page and closes itself.

Since the user is not interacting with the pop-up, I would prefer it to be hidden. Can this be done ? I checked a Javascript book, which says the 'alwaysLowered' property can be used to send the pop-up behind other windows but this is a security feature and available only for signed scripts.

My Questions are:
1. Can the pop-up be hidden ?
2. What is a signed script ?

Recommended Answers

All 10 Replies

It depends on the way your creating the window. I'm sure there are many ways to do it. If I remeber correctly you can do it via this method:

var win = new PopupWindow();
 
win.showPopup();
 
win.setUrl("http://www.site.com");
 
win.hidePopup();

Hope this helps you.

Sorry, it's not working. I am getting the error
"PopupWindow is undefined"

Here's the code (with what I was using earlier)

var newWindow ;
var v_Options;
var v_Bars;
v_Bars = 'directories=no, location=no, menubar=no, status=no,titlebar=no,toolbar=no';
v_Options = 'scrollbars=yes,resizable=no,Height=10,Width=10,left=100,top=100,visible=false,alwaysLowered=yes';
//newWindow = window.open("Popdata.htm",'PrintWin',v_Bars + ',' + v_Options);
newWindow = new PopUpWindow() ;
newWindow.showPopup();
newWindow.setURL("Popdata.htm");
newWindow.hidePopup();

Actually, opening a hidden window is on the list of operations forbidden for security reasons.

But there is nothing to prevent you from putting it under something. It still shows on the taskbar.

"Putting it under something" = Putting it behind another window ? That's fine with me. But how do I do that ? By setting the z-order of the window ? If it shows in the taskbar, it's acceptable.

Just drop something else on top of it real fast, or send the focus to the page under it.

I had a similar objective, and achieved it with an I frame
In the HTML :
<iframe id="Download_Frame" style="display:none; visibility:hidden;">
JunkMessage
</iframe>

In the Javascript :
MyIFrame = document.getElementById("Download_Frame");
MyIFrame.src = "MyUrl.php?params=" + Parameters;

It worked fine for me.

As far as I know, IFrame is supported only by IE. Unfortunately I need it to be cross browser compatible. Is IFrame supported by all major browsers like Firefix, Opera, etc ?

This is the purpose of AJAX
cross browser compatible
no popup window issues
automatically loads in the current page

I am not good with AJAX, but I got my page loading and updating with these code samples http://daniel.lorch.cc/docs/ajax_simple/

As far as I know, IFrame is supported only by IE. Unfortunately I need it to be cross browser compatible. Is IFrame supported by all major browsers like Firefix, Opera, etc ?

I used it for Firefox, IE and Opera (didn't test any others)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.