I want make a integrated search service site. I referenced this and this. There are a few problems.
HTML :
<div id="integrated_search_form">
<form>
<input type="search" name="" id="integrated_search_word">
<input type="submit" value="search" id="integrated_search_button">
</form>
</div>
<div id="search_result_website_div01">
<form>
<input type="text" name="" id="website_url_01">
<input type="submit" value="submit">
</form>
<object id="myobj" data="" type="text/html">Not loading</object>
</div>
JS :
<script src="https://code.jquery.com/jquery-3.4.1.js"></script>
<script>
//
$(document).ready(function(){
//
var $dynamic_integrated_search_word = $('#integrated_search_word');
var $dynamic_url_01 = $('#website_url_01'); // https://en.wikipedia.org/wiki/
$('#myobj').attr('data', $dynamic_url_01) // Problem 1
.css({
width: 400,
height: 300,
background: 'gray',
overflow: scroll
});
// Problem 2
/*
$('body').find('input[type = search]').val('wiki');
$('body').find('input[type = search]').parents('form').submit();
*/
// Problem 3 - under 3 things not working all.
/*
.console.log($('body').find('input[type = search]').val('wiki'))
.contents().find('input[type = search]').val('wiki')
.load(function(){
$(this).contents().find('input[type = search]').val('wiki')
});
*/
});
Problem 1:
object 'data' attr insert static value(?) like 'https://en.wikipedia.org/wiki/' is working well. But when I insert dynamic variable is not working.
Problem 2: Entered the following sentence in the developer tool's console.
// $('body').find('input[type = search]').val('wiki');
// $('body').find('input[type = search]').parents('form').submit();
this works well on wikipedia, but it doesn't work on Google or any other wiki sites.
Problem 3: I want to produce the same result by JQuery as I entered the following sentence in the developer tool's console at each site.