Home Page

Generate Summary

jQuery(‘#summaryForm’).submit(function(e) { e.preventDefault(); // Prevent form from refreshing the page

var userText = jQuery(‘#userText’).val(); // Get the user’s input

jQuery.ajax({ url: ‘/wp-admin/admin-ajax.php’, // Default URL for handling AJAX requests in WordPress type: ‘POST’, data: { action: ‘generate_summary’, // The action that triggers the PHP function user_text: userText // User’s input }, success: function(response) { jQuery(‘#summaryResult’).html(response); // Display the resu