-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbom.js
More file actions
181 lines (159 loc) · 6.37 KB
/
Copy pathbom.js
File metadata and controls
181 lines (159 loc) · 6.37 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
window.onload= function(){
var imagen =document.getElementById("imagen");
var browser = navigator.userAgent;
var f = browser.search("Firefox");
var c = browser.search("Chrome");
var s = browser.search("Safari");
console.log("Expresion: ", f);
console.log("Expresion: ", c);
console.log("Expresion: ", s);
console.log(f > 1);
console.log(c > 1);
console.log(s > 1);
if (f > 1) {
document.getElementById("navegador").innerHTML = "Bienvenido usuario de Firefox";
imagen.src = "img/Firefox.png";
imagen.style.width = "100px";
imagen.style.height = "100px";
}
if (c > 1) {
document.getElementById("navegador").innerHTML = "Bienvenido usuario de Chrome";
imagen.src = "img/chrome.png";
imagen.style.width = "100px";
imagen.style.height = "100px";
}
if (s > 1 && c < 1) {
document.getElementById("navegador").innerHTML = "Bienvenido usuario de Safari";
imagen.src = "img/Safari.png";
imagen.style.width = "100px";
imagen.style.height = "100px";
}
console.log("imagen: ", imagen);
console.log("navegador: ", browser);
}
/*===============================================
the browser object model (BOM) allows JavaScript to "talk to" the browser.
==============================================*/
var w = window.innerWidth
|| document.documentElement.clientWidth
|| document.body.clientWidth;
var h = window.innerHeight
|| document.documentElement.clientHeight
|| document.body.clientHeight;
var x = document.getElementById("prueba");
x.innerHTML = "Ancho de la ventana interior del navegador: " + w + ", altura: " + h + ".";
/*===============================================
Window Screen Width
La propiedad screen.width devuelve el ancho de la pantalla del visitante en pixeles.
==============================================*/
document.getElementById("prueba2").innerHTML = "El ancho de la pantalla es: " + screen.width;
/*===============================================
Window Screen Height
La propiedad screen.Height devuelve el ancho de la pantalla del visitante en pixeles.
==============================================*/
document.getElementById("prueba3").innerHTML = "El alto de la pantalla es: " + screen.height;
/*===============================================
Window Location Href
==============================================*/
document.getElementById("prueba4").innerHTML = "La url de la página es :<br>" + window.location.href;
/*===============================================
Window History Back
==============================================*/
function goBack() {
window.history.back()
}
/*===============================================
Window History Forward
==============================================*/
function goForward() {
window.history.forward()
}
/*===============================================
JavaScript Window Navigator
==============================================*/
document.getElementById("prueba5").innerHTML = "cookiesEnabled is: " + navigator.cookieEnabled;
/*===============================================
Browser Application Name
==============================================*/
document.getElementById("prueba6").innerHTML = "El nombre de la app es: " + navigator.appName;
/*===============================================
Browser Application Code Name
==============================================*/
document.getElementById("prueba7").innerHTML = "el nombre clave de la aplicacion es: " + navigator.appCodeName;
/*===============================================
The Browser Engine
==============================================*/
document.getElementById("prueba8").innerHTML = "el producto es " + navigator.product;
/*===============================================
The Browser Version
==============================================*/
document.getElementById("prueba9").innerHTML = navigator.appVersion;
/*===============================================
The Browser Agent
==============================================*/
/*===============================================
The Browser Platform
==============================================*/
document.getElementById("prueba11").innerHTML = "cual es la plataforma utilizada: " + navigator.platform;
/*===============================================
The Browser Lenguaje
==============================================*/
document.getElementById("prueba12").innerHTML = "cual es el lenguaje que utiliza: " + navigator.language;
/*===============================================
Is The Browser Online?
==============================================*/
document.getElementById("prueba13").innerHTML = "el navegador esta en linea: " + navigator.onLine;
/*===============================================
Is Java Enabled?
==============================================*/
document.getElementById("prueba14").innerHTML = "el navegador esta habilitado: " + navigator.javaEnabled();
/*===============================================
==============================================*/
function myFunction() {
alert("I am an alert box!");
}
/*===============================================
Confirm Box
==============================================*/
function myFunction() {
var txt;
if (confirm("Press a button!")) {
txt = "You pressed OK!";
} else {
txt = "You pressed Cancel!";
}
document.getElementById("prueba15").innerHTML = txt;
}
/*===============================================
Prompt
==============================================*/
function myFunction() {
var txt;
var person = prompt("Please enter your name:", "Neftali Cabrera");
if (person == null || person == "") {
txt = "User cancelled the prompt.";
} else {
txt = "Hola" + person + "! Como estas el dia de hoy?";
}
document.getElementById("prueba16").innerHTML = txt;
}
/*===============================================
JavaScript Timing Events
==============================================*/
function myFunction() {
alert('Hola');
}
/*===============================================
JavaScript Timing Events
==============================================*/
function myFunction() {
alert("Hola");
}
/*===============================================
Muestra la hora actual
==============================================*/
var myVar = setInterval(myTimer ,1000);
function myTimer() {
var d = new Date();
document.getElementById("prueba18").innerHTML = d.toLocaleTimeString();
}