I have a query, how could I implement an ajax method so that the search engine will bring the data in the ID that is given to it (it should be noted that the one that brings the data and the search engine are on the same page, the view that loads all this is another page)
$('.data-show-01').click(function (e) {
e.preventDefault();
var me = $(this),
url = me.attr('href');
getData(url)
});
function getData(url) {
$.ajax({
url: url,
dataType: 'html',
success: function (response) {
$('#loadData').html(response);
}
});
};
// con esto traigo la data al carga la pagina html
//esta es la pagina que me trae la data
<div class="search">
<form class="searchForm" action="{{ route( 'tipo',['estado' => Crypt::encrypt($estado_id),'tipo' => Crypt::encrypt($tipo_id)]) }}" method="get">
<div class="u-relative">
<input type="text" name='number' class="field__input" placeholder="Buscar por número de expediente">
<button type='submit' class="searchForm__submit">
<svg>
<use xlink:href="#search"></use>
</svg>
</button>
</div>
</form>
</div>
// que llenarse el contenido aqui al momento
// de realizar una busqueda
<div class="loadData" id="loadData">
</div>
function getData(url) {
$.ajax({
url: url,
dataType: 'html',
success: function (response) {
$('#loadData').html(response);
}
});
};
$('.data-show-01').click(function (e) {
e.preventDefault();
var me = $(this),
url = me.attr('href');
getData(url)
});