Estoy renderizando un script php en mi html con la carga de la función jquery, así que ahora quiero usar javascript puro sin la biblioteca jquery. Aquí está el código:
$(()=>{ $('#loadTable').load('./php/loadTable.php'); })¿Cómo puedo lograr esto usando javascript puro?
Usando fetch y Element.innerHTML :
fetch('./php/loadTable.php') .then(resp => { // TODO: add error handling return resp.text(); }) .then(text => { document.querySelector('#loadTable').innerHTML = text; });