- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunction.html
More file actions
Latest commit
128 lines (105 loc) · 3.12 KB
/
Copy pathfunction.html
File metadata and controls
128 lines (105 loc) · 3.12 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
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<!DOCTYPE html>
<htmllang="en">
<head>
<metacharset="UTF-8">
<title>demo</title>
<scriptsrc="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
</head>
<body>
<pid="ja"></p>
<buttononclick="getData('John','27', 'Male')">Get Data</button>
<script>
functiongetData(name,age,gender){
//document.write(name + ' is ' + age + ' years old. He is a ' + gender + '.');
document.getElementById('ja').innerHTML=name+' is '+age+' years old. He is a '+gender+'.'
}
</script>
<br/><br/>
<buttononclick="matchTeam()">Concatenate Function</button>
<script>
functionteam(team1,team2){
varteam;
team=team1+' V/S '+team2;
returnteam;
}
functionmatchTeam(){
varmatchT;
matchT=team('India','Australia');
//return matchT;
document.getElementById('ja').innerHTML=matchT;
}
</script>
<br/><br/>
<buttononclick="getFullName()">Get Full Name</button>
<script>
varfirst='John';
varlast='Shaw';
varfull=function(){
returnthis.first+' '+this.last;
}
functiongetFullName(){
document.getElementById('ja').innerHTML=full();
}
</script>
<br/><br/>
<buttononclick="getFullName2()">Get Full Name 2</button>
<script>
functiongetFullName2(first2,last2){
first2='Doe';
last2='Singh';
document.getElementById('ja').innerHTML=first2+' '+last2;
}
</script>
<br/><br/>
<buttononclick="getMovieName()">Concatenate Function2</button>
<script>
functiongetMovie(morning,evening,night){
varshowM=morning+' '+evening+' '+night;
returnshowM;
}
functiongetMovieName(){
varmovie=getMovie('Dangal','Wanted','Bahubali');
document.getElementById('ja').innerHTML=movie;
}
</script>
<br/><br/>
<buttononclick="getDinnerL()">Concatenate Function3</button>
<script>
vardinner;
functiongetDinnerL(startar,maain,desert){
dinner=startar+maain+desert;
returndinner;
}
document.getElementById('ja').innerHTML=getDinnerL('a','b','c');
</script>
<br/><br/>
<buttononclick="redirectPage()">Redirect</button>
<script>
functionredirectPage(){
//window.location.href = 'https://www.google.co.in/';
window.open('https://www.google.co.in/','_blank');
}
/*(function(){
window.open('https://www.google.co.in/', '_blank');
})();*/
</script>
<br/><br/>
<buttononclick="autoRedirectPage()">Auto Redirect</button>
<script>
functionautoRedirectPage(){
window.open('https://www.google.co.in/','_blank');
}
//setTimeout('autoRedirectPage()', 1000);
</script>
<br/><br/>
<buttononclick="browserRedirect()">Browser Redirect</button>
<script>
functionbrowserRedirect(){
varbrRd=navigator.userAgent;
alert(brRd);
}
</script>
<br/><br/>
<buttononclick="window.print()">Print Page</button>
</body>
</html>