JSFiddle - React, Tailwind, and code Playground
by karthick Chandran
HTML
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<div class="container" style="padding-top:10px">
<input type="text" id="searchInput" value="" style="width:300px" />
<style>
table {
border-collapse: collapse;
padding:2px;
}
table, th, td {
border: 1px solid black;
padding:2px;
}
</style>
<input type="button" value="Search" onclick="Load();" />
<span id="exTime">
</span>
<div>
<table style="widht:100%">
<tr>
<td style="width:33%;valign:top">
<div id="list">
</div>
</td>
<td style="width:33%;vertical-align:top" >
<div id="list2">
</div>
</td>
<td style="widht:34%">
<iframe src="https://www.google.com/search?q=hadoop" frameborder="0" style="overflow:hidden;height:100%;width:100%" height="100%" width="100%"></iframe>
</td>
</tr>
</table>
</div>
</div>
<script>
$("#searchInput").keyup(function(event) {
if (event.keyCode === 13) {
Load();
}
});
function Load() {
$("#exTime").val();
var start_time = new Date().getTime();
var input = $("#searchInput").val();
$.getJSON('https://www.googleapis.com/customsearch/v1?key=AIzaSyAsJAKLPLvq9t83GkX9FnFncVbjMxntYjg&cx=015837469978072049255:6ofvfi5hsk4&q=' + encodeURIComponent(input) + '&callback=?', function(response) {
var request_time = new Date().getTime() - start_time;
$("#exTime").val(request_time + ' ms');
var pages = response.items;
console.log(pages);
$("#list").empty();
for (var i = 0; i < pages.length; i++) {
$("#list").append('<h2>' + pages[i].title + '</h2>' + '<div>' + pages[i].snippet + '</div>' + '<div>' + '<a target="_blank" href="' +...