-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathLoadEventExample07.htm
31 lines (28 loc) · 987 Bytes
/
LoadEventExample07.htm
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
<!DOCTYPE html>
<html>
<head>
<title>Load Event Example</title>
<script type="text/javascript" src="EventUtil.js"></script>
</head>
<body>
<script type="text/javascript">
EventUtil.addHandler(window, "load", function(){
var script = document.createElement("script");
EventUtil.addHandler(script, "load", function(event){
alert("Loaded");
});
script.src = "example.js";
document.body.appendChild(script);
var link = document.createElement("link");
link.type = "text/css";
link.rel= "stylesheet";
//opera only
EventUtil.addHandler(link, "load", function(event){
alert("css loaded");
});
link.href = "example.css";
document.getElementsByTagName("head")[0].appendChild(link);
});
</script>
</body>
</html>