skip to Main Content

Can I insert data to custom table using ajax in a WordPress plugin?

I am trying to insert data in custom table in wordpress while creating plugin using AJAX. But I failed to do. here is the code of contact.php where I register scripts add_action('wp_enqueue_scripts', 'setting_up_scripts_contact_form_wp'); function setting_up_scripts_contact_form_wp() { wp_register_style( 'contact-custom-style',plugins_url('public/css/style.css', __FILE__) );…

VIEW QUESTION

Can HTML fetch data using AJAX in a table?

<!DOCTYPE html> <html> <head> <title>Fetch data from API and display in table using AJAX</title> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> </head> <body> <h1>Data</h1> <table id="table" border="1"></table> <script> function load(){ fetch("https://gorest.co.in/public/v2/users") .then(result => result.json) .then(json => show(json)) } function show(data){ let table = document.getElementById('table'); for(let…

VIEW QUESTION
Back To Top
Search