1
My universe is as follows:
The attendant is with an open guide, making, obviously, a service. To end this service, URA already starta a second service. Turns out IVR opens another tab. By closing this service, this guide is not closed and if the URA opens another, will be open as many guides as the URA open. It would have to come manually closing, and at least one tab should be open, due to the login, ie the first tab. What happens is that the IVR is an external agent, so this tab(page) opened cannot be controlled by the tab that is open, because it was not the one who opened it. I would like to make a code (javascript) that closes the tab in question. I’ve tried to:
parent.self.close();
window.close();
self.close();
Anyway, there were several attempts and none worked. The guide does not close.
We use ASP
Classic and Javascript
.
<script defer language="javascript">
if (window.ActiveXObject) {
window.open('ace002c.asp?/cal/asp/cal0087b.asp$$$pt=Atendimento&pcf=ATB0082&num_associado=<%=num_associado%>&ind_origem_consulta=A&statusAtendimento=A&vinculacao=beneficiario&origem=CALLCENTER&tipo_atendimento_beneficiario=N', 'JANELA', 'top=0,left=0');
}
else {
alert(3);
sessionStorage.setItem("URL_ATENDIMENTO_URA", true);
window.open("ace002c.asp?/cal/asp/cal0087b.asp$$$pt=Atendimento&pcf=ATB0082&num_associado=<%=num_associado%>&ind_origem_consulta=A&statusAtendimento=A&vinculacao=beneficiario&origem=CALLCENTER&tipo_atendimento_beneficiario=N", '_blank');
}
//open(location, '_self').close();
//alert(12);
//debugger;
window.onbeforeunload = null;
//console.log('teste1');
parent.self.close();
//alert(13);
</script
>
And this code below, I simulate URA:
http://teste.dev.amil.com.br/ace/iniciaAtendimento.asp?protocolo=326338
Pages are opened within FRAMES(Iframe). This system is a legacy here in the company.
When I use the _self
, it carries the information and closes itself(parent.self.close()
), but do not skip the user screen. What should be done is that the attendance screen should be poped, regardless of which screen is open by the user, usually it is not open when closing a call. I did it that way with _self
.
window.open("ace002c.asp?/cal/asp/cal0087b.asp$$$pt=Atendimento&pcf=ATB0082&num_associado=<%=num_associado%>&ind_origem_consulta=A&statusAtendimento=A&vinculacao=beneficiario&origem=CALLCENTER&tipo_atendimento_beneficiario=N", '_self');
What is the code to open new guides? you want me to close from inside the tab or controlling from outside the tab?
– Sergio
Try window.open(Location, '_self'). close(); Which browser/version is using ?
– Mauro Alexandre
@Mauroalexandre, Chrome
– pnet
It didn’t work either. Important information was missing and I will edit the post.
– pnet
In IE it works. Why? Well, in IE it is possible to name windows and in this way, I believe that IE uses its internal mechanisms to locate these windows and thus close them, open them and etc. Chrome does not have this concept as I understood.
– pnet