index.js
1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
$(document).ready(function(){
checkRTXLogin();
})
function checkRTXLogin(){
$.post("/api/integration/imrtx/getAutoLoginIM", {}, function(data){
var src = "";
if(data.flag == 1) {
src = "/RTXClientOpen.jsp";
}else if(data.flag == 2) {
src = "/EimClientOpen.jsp";
}
checkRTXLoginUrl(src);
},"json");
}
function checkRTXLoginUrl(src) {
if(src) {
var iframe = "";
try{
iframe = document.createElement('<iframe name="rtxClient" style="display:none"></iframe>');
}catch(e){
iframe = document.createElement("iframe");
iframe.style.display = "none";
iframe.name = 'rtxClient';
}
iframe.src = src;
var rtxchecklogDIV = document.getElementById("rtxchecklogDIV");
if(rtxchecklogDIV) {
rtxchecklogDIV.style.visibility = "hidden";
rtxchecklogDIV.style.display = "none";
var rtxchecklogIframe = rtxchecklogDIV.getElementsByTagName('iframe');
if(rtxchecklogIframe && rtxchecklogIframe[0]) {
rtxchecklogDIV.removeChild(rtxchecklogIframe[0]);
}
rtxchecklogDIV.appendChild(iframe);
}else {
var div = document.createElement("div");
div.id = "rtxchecklogDIV";
div.style.visibility = "hidden";
div.style.display = "none";
div.appendChild(iframe);
document.body.appendChild(div);
}
}
}