-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch-container.html
40 lines (34 loc) · 1.14 KB
/
search-container.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
<script>
//(function() {
//var cx = '011342397880366363275:3ghhqnazmee';
//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);
//})();
</script>
<!--
<gcse:searchbox-only></gcse:searchbox-only>
-->
<script>
var getUrlParameter = function getUrlParameter(sParam) {
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
sURLVariables = sPageURL.split('&'),
sParameterName,
i;
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] === sParam) {
return sParameterName[1] === undefined ? true : sParameterName[1];
}
}
};
var strQuery = getUrlParameter('q');
window.location.href = "https://www.google.com/search?q=site:containerportaworld.blogspot.co.id "+ strQuery;
</script>
<!--
Aturan mainnya:
this script grabs the URL Parameter and redirect the param into query in Google SERP
-->