Link to home
Start Free TrialLog in
Avatar of Vadim Rapp
Vadim RappFlag for United States of America

asked on

Javascript: open popup, wait till loaded, close

In SSRS report showing pending invoices, in the last column I have a hyperlink that marks the invoice as sent. This is accomplished by setting Action to the following:

="javascript:w=window.open('http://myserver/MarkInvoiceAsSent/?invoice_id=12345');w.close();document.location.reload(true);"

"MarkInvoiceAsSent" is an asp page that quietly performs the requested database transaction, with no output. "12345" is for this example only, in fact it substitutes the correct value from this row.

The problem is that w.close closes the page before it has opened, so the transaction is not performed.

Is there a way to modify javascript so that it would wait until the page is complete before closing it? Or perhaps some other way to accomplish this.
ASKER CERTIFIED SOLUTION
Avatar of Vadim Rapp
Vadim Rapp
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial