العنوان |
مبدأ عدم تجزئة مدفوعات الحساب الجاري |
---|
jQuery(document).ready(function($) { // Send the AJAX request when the page is loaded $.ajax({ url: viewCounter.ajax_url, // The AJAX URL from wp_localize_script type: 'POST', data: { action: 'my_update_view_counter', // The action that matches our PHP handler nonce: viewCounter.nonce, // The security nonce post_id: viewCounter.post_id // The current post ID }, success: function(response) { if (response.success) { console.log('View count updated successfully.'); } else { console.log('Error updating view count: ' + response.data); } }, error: function() { console.log('AJAX request failed.'); } }); });
Skip to content