The elegant way would be to have a separate(!) PHP file that will only output the number times 2
part of your current PHP. Then you generate an AJAX request from your current PHP to the new separate PHP.
More Related Contents:
- How do I run ajax request in background continuously?
- Tagging systems [closed]
- How to use this code my wordpress theme
- using jquery $.ajax to call a PHP function
- Ajax Upload image
- how to do file upload using jquery serialization
- How to get the jQuery $.ajax error response text?
- Send array with Ajax to PHP script
- Get response from PHP file using AJAX
- PHP/Apache/AJAX – POST limit?
- Jquery/Ajax Form Submission (enctype=”multipart/form-data” ). Why does ‘contentType:False’ cause undefined index in PHP?
- HTML – Change\Update page contents without refreshing\reloading the page
- Ajax passing data to php script
- jQuery AJAX form using mail() PHP script sends email, but POST data from HTML form is undefined
- Passing Javascript Variable to PHP using Ajax
- Ajax post request in laravel 5 return error 500 (Internal Server Error)
- Inserting into MySQL from PHP (jQuery/AJAX)
- Retrieve JSON POST data in CodeIgniter
- Jquery – Uncaught TypeError: Cannot use ‘in’ operator to search for ‘324’ in
- Pass data from jQuery to PHP for an ajax post
- Jquery ajax setTimeout after form succes not redirecting?
- Ajax call with contentType: ‘application/json’ not working
- jQuery Ajax passing value on php same page
- How to rotate image and save the image
- Cross Domain Ajax Request with JQuery/PHP
- When do I use PHP_EOL instead of \n and vice-versa ? Ajax/Jquery client problem
- Codeigniter CSRF valid for only one time ajax request
- Ajaxify header cart items count in Woocommerce
- PhP Upload progress in PhP 5.4 is not working. Session variables not set
- How to Load Ajax in WordPress