Showing
7 changed files
with
98 additions
and
0 deletions
10_JavaScriptForWebBrowser/01.original.html
0 → 100644
1 | +<html> | ||
2 | +<head> | ||
3 | +<script type="text/javascript"> | ||
4 | +function message(){ | ||
5 | +alert("This alert box was called with the onload event"); | ||
6 | +} | ||
7 | +</script> | ||
8 | +</head> | ||
9 | + | ||
10 | +<body onload="message()"> | ||
11 | +<script type="text/javascript"> | ||
12 | +document.write("This message is written by JavaScript"); | ||
13 | +</script> | ||
14 | +</body> | ||
15 | + | ||
16 | +</html> |
1 | +<html> | ||
2 | +<head> | ||
3 | +<script type="text/javascript" src="xxx.js"></script> | ||
4 | + | ||
5 | +<script type="text/javascript"> | ||
6 | +function message(){ | ||
7 | +alert("This alert box was called with the onload event"); | ||
8 | +} | ||
9 | +</script> | ||
10 | +</head> | ||
11 | + | ||
12 | +<body onload="message()"> | ||
13 | +</script> | ||
14 | +</body> | ||
15 | + | ||
16 | +</html> |
10_JavaScriptForWebBrowser/03.RegExp.html
0 → 100644
1 | +<html> | ||
2 | +<head> | ||
3 | +</head> | ||
4 | + | ||
5 | +<body> | ||
6 | +<script type="text/javascript"> | ||
7 | + | ||
8 | +var str="Hello world!"; | ||
9 | +//look for "Hello" | ||
10 | +var patt=/Hello/g; | ||
11 | +var result=patt.exec(str); | ||
12 | +document.write("Returned value: " + result); | ||
13 | + | ||
14 | +//look for "W3Schools" | ||
15 | +patt=/W3Schools/g; | ||
16 | +result=patt.exec(str); | ||
17 | +document.write("<br />Returned value: " + result); | ||
18 | + | ||
19 | + | ||
20 | +</script> | ||
21 | + | ||
22 | +</body> | ||
23 | + | ||
24 | +</html> |
10_JavaScriptForWebBrowser/alert.js
0 → 100644
10_JavaScriptForWebBrowser/xxx.js
0 → 100644
1 | +document.write("This message is written by JavaScript"); |
-
Please register or login to post a comment