-
Notifications
You must be signed in to change notification settings - Fork 1
/
js_lec_3.js
126 lines (98 loc) · 3.14 KB
/
js_lec_3.js
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
// switch statement
// Syntax
// switch(expression){
// case n1:
// statements;
// break;
// case n2:
// statements;
// break;
// default:
// statements;
// }
var number = 2;
switch(number){
case 1:
document.write("Case 1 Matched!");
break;
case 2:
document.write("Case 2 Matched!<br>");
break;
case 10:
document.write("Case 10 Matched!");
break;
default:
document.write("Default Case Matched!");
}
// loops
// document.write("eRozgaar<br>");
// for(statement 1; statement 2; statement 3){
// // statements
// }
// statement 1: executes before the loop
// starts
// statement 2: define the condition
// for running the app.
// statement 3: executes after every loop
// for(var i=0; i < 1000; i++){
// document.write("eRozgaar<br>");
// }
// for(var a=0; false; a++){
// document.write("eRozgaar<br>");
// }
// document.write("Ajeeb c for loop<br><br>");
// var x = 1;
// for(document.write("for loop statement 1<br>");
// x <= 2;
// document.write("for loop statement 3<br>"))
// {
// document.write("eRozgaar<br>");
// x++;
// }
// document.write("<br><br>Ajeeb c for loop<br><br>");
// var z=1;
// for(;z<=10;){
// z++
// document.write("eRozgaar<br>");
// }
document.write("<table><tr><th>ID</th><th>Name</th><th>CNIC</th><th>Domain</th></tr>");
for(var z=0; z<=9; z++){
document.write("<tr><td>"+ z +"</td><td>Shajeel</td><td>35302</td><td>Domain</td></tr>");
}
document.write("</table>");
var html = '<table style="width:100%"> \
<tr>\
<th>ID</th>\
<th>Name</th> \
<th>CNIC</th> \
<th>Domain</th> \
</tr> \
<tr> \
<td>1</td> \
<td>Shajeel</td> \
<td>35302</td> \
<td>Domain</td> \
</tr> \
</table> \
'
var str = '<div data-role="page" data-add-back-btn="true" id="Gallery2" class="gallery-page"> \
<div data-role="header"> \
<h1>Second Gallery</h1> \
</div> \
<div data-role="content"> \
<ul class="gallery"> \
<li><a href="images/full/010.jpg" rel="external"><img src="images/thumb/010.jpg" alt="Image 010" /></a></li> \
<li><a href="images/full/011.jpg" rel="external"><img src="images/thumb/011.jpg" alt="Image 011" /></a></li> \
<li><a href="images/full/012.jpg" rel="external"><img src="images/thumb/012.jpg" alt="Image 012" /></a></li> \
<li><a href="images/full/013.jpg" rel="external"><img src="images/thumb/013.jpg" alt="Image 013" /></a></li> \
<li><a href="images/full/014.jpg" rel="external"><img src="images/thumb/014.jpg" alt="Image 014" /></a></li> \
<li><a href="images/full/015.jpg" rel="external"><img src="images/thumb/015.jpg" alt="Image 015" /></a></li> \
<li><a href="images/full/016.jpg" rel="external"><img src="images/thumb/016.jpg" alt="Image 016" /></a></li> \
<li><a href="images/full/017.jpg" rel="external"><img src="images/thumb/017.jpg" alt="Image 017" /></a></li> \
<li><a href="images/full/018.jpg" rel="external"><img src="images/thumb/018.jpg" alt="Image 018" /></a></li> \
</ul> \
</div> \
<div data-role="footer"> \
<h4>© 2011 Code Computerlove</h4> \
</div> \
</div>';