-
Notifications
You must be signed in to change notification settings - Fork 2
/
moteurgoogle.html
69 lines (61 loc) · 2.23 KB
/
moteurgoogle.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel = "stylesheet" type = "text/css" href= "./css/recherche.css" />
</head>
<script src = "https://www.youtube.com/iframe_api" ></script>
<body>
<div class = "test" onclick = "captureLien()" ><p class = "confirm" onclick = "captureLien()">confirmation</p></div>
<div class = "recherche">
<script>
compteur = 0;
(function() {
var cx = '002590007848321285987:ahbmmnrn4yk';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
var x = document.getElementsByTagName("a")[2];
})();
function captureLien() {
if (compteur == 1){
fenetre = document.getElementsByTagName("iframe")[0];
document.body.removeChild(fenetre);
var x = document.getElementsByTagName("a")[2];
var fenetre = document.createElement("iframe");
var v = x.toString().slice(32);
console.log(v);
fenetre.setAttribute("width", "640");
fenetre.setAttribute("height", "390");
fenetre.setAttribute("id", "ytplayer");
fenetre.setAttribute("src","http://www.youtube.com/embed/" + v +"?autoplay=1&enablejsapi=1&?allowfullscreen=1" );
fenetre.classList.add("fenetre1");
fenetre.setAttribute("type", "text/html");
fenetre.setAttribute("border", "");
document.body.appendChild(fenetre);
}
else {
var x = document.getElementsByTagName("a")[2];
var fenetre = document.createElement("iframe");
var v = x.toString().slice(32);
console.log(v);
fenetre.setAttribute("width", "640");
fenetre.setAttribute("height", "390");
fenetre.setAttribute("id", "ytplayer");
fenetre.setAttribute("src","http://www.youtube.com/embed/" + v +"?autoplay=1&enablejsapi=1&?allowfullscreen=1" );
fenetre.classList.add("fenetre1");
fenetre.setAttribute("type", "text/html");
fenetre.setAttribute("border", "");
document.body.appendChild(fenetre);
compteur = 1;
}
}
</script>
<gcse:searchbox class = "search"></gcse:searchbox></div>
<div class = "resultats"><gcse:searchresults></gcse:searchresults></div>
</body>
</html>