var url = "/wp-admin/admin-ajax.php";
jQuery(document).ready(function($) {
$.post( url , {
action: 'ty_questgo'
}).done(function( response ) {
console.log( response );
});
});
fetch( url, {
method: 'POST',
headers: new Headers({
'Content-Type': 'application/x-www-form-urlencoded',
'Cache-Control': 'no-cache'
}),
credentials: 'same-origin',
body: new URLSearchParams({
action: 'ty_questgo',
}),
}).then(response => response.json())
.then(response => console.log(response))
.catch(err => console.log(err));