16 |
f(a);g(args); |
f(a);g(args); |
17 |
} |
} |
18 |
}; |
}; |
19 |
|
function addUnLoadEvent(func) { |
20 |
|
var oldonunload = window.onunload; |
21 |
|
if (typeof window.onunload != 'function') { |
22 |
|
window.onunload = func; |
23 |
|
} else { |
24 |
|
window.onunload = function() { |
25 |
|
if (oldonunload) { |
26 |
|
oldonunload(); |
27 |
|
} |
28 |
|
func(); |
29 |
|
} |
30 |
|
} |
31 |
|
} |
32 |
|
addUnLoadEvent(meteordestroy); |
33 |
|
function meteordestroy() { |
34 |
|
var x = Meteor.instances.length; |
35 |
|
for(var i=0; i<x; i++) { |
36 |
|
if (typeof(Meteor.instances[i].transferDoc)=="object") { |
37 |
|
Meteor.instances[i].transferDoc.open(); |
38 |
|
Meteor.instances[i].transferDoc.close(); |
39 |
|
delete Meteor.instances[i].transferDoc; |
40 |
|
} |
41 |
|
if (document.getElementById("meteorframe_"+Meteor.instances[i].instID)) { |
42 |
|
document.body.removeChild(document.getElementById("meteorframe_"+Meteor.instances[i].instID)); |
43 |
|
} |
44 |
|
delete Meteor.instances[i]; |
45 |
|
} |
46 |
|
} |
47 |
|
|
48 |
function Meteor(instID) { |
function Meteor(instID) { |
49 |
|
|