wordpress ajax url

Solutions on MaxInterview for wordpress ajax url by the best coders in the world

showing results for - "wordpress ajax url"
Katrin
18 Nov 2019
1<?php
2add_action( 'wp_footer', 'my_ajax_without_file' );
3
4function my_ajax_without_file() { ?>
5
6    <script type="text/javascript" >
7    jQuery(document).ready(function($) {
8
9        ajaxurl = '<?php echo admin_url( 'admin-ajax.php' ) ?>'; // get ajaxurl
10
11        var data = {
12            'action': 'frontend_action_without_file', // your action name 
13            'variable_name': "Some value" // some additional data to send
14        };
15
16        jQuery.ajax({
17            url: ajaxurl, // this will point to admin-ajax.php
18            type: 'POST',
19            data: data,
20            success: function (response) {
21                console.log(response);                
22            }
23        });
24    });
25    </script> 
26    <?php
27}
28
29add_action("wp_ajax_frontend_action_without_file" , "frontend_action_without_file");
30add_action("wp_ajax_nopriv_frontend_action_without_file" , "frontend_action_without_file");
31
32function frontend_action_without_file(){
33    echo json_encode($_POST);
34    wp_die();
35}
36
37?>
38
queries leading to this page
how to put url in ajax in wordpressregister url call via ajax wordpressadmin ajax url phpajax url wordpresswordpress admin ajax url functionurl 3a wp ajax ajax url uncaught referencewordpress get ajax url 3bwp ajax wordpress exampleget ajaxurl in wordpresswordpress document ajaxurl undefinedwp base urlwordpress ajax url pathurl ajax wordpresswordpress ajax url examplejquery get admin ajax urlget ajax url wordpresssget ajax url in wordpresswordpress admin ajax urlajax url wordpress frontend getwordpress enable ajaxwordpress ajaxurl has not been definedwordpress admin ajax urwordpress ajax url to functions phphow to use ajax in wordpress without urlwordpress ajax url path registerwp ajax url wordpressajaxurl jquery ajaxwordpress how to find ajax urlwordpress ajax urlwp get ajax url phpajax url wpphp get ajax url wordpresswp call ajaxwordpress ajax urljquery wordpress ajax urlwordpress ajax url javascriptwordpress set ajax urlwordpress ajaxurlmake link with ajax request wordpressajax in wordpress urlhow to ajax call directly use url in wordpresshow to solve ajax request url in wordpressget wordpress ajax urlajax url in wpajax wordpress urlajax wordpresswordpress get ajax url phpwordpress ajax url change https to httpurl ajax wpadmin ajax php urlwordpress ajax examplewordpress ajax linkajax url wordpress call php functionwordpress ajax in urlget ajax admin page in js filewordpress custom ajax pathlink to ajax request wordpresshow to give ajax url in wordpressajax php url wordpresswordpress change home urlhow to add ajax url in wordpresssend ajax to wordpress functions phpajax url not defined wordpresswp ajax urlwordpress ajax url in jquerywordpress script inline ajaxurlwp ajax urlwp ajax url exampleajax url wordpress frontendajax url update wordpress urlwordpress get admin ajax urlwordpress jquery ajax urljquery ajax wordpress urlwordpress get url to wp ajaxwhat is wordpress ajax urldefine ajax url in wordpresswp ajax url in wordpressajax url in wordpresswordpress javascript ajax urlajax url jquery wordpressadmin url ajaxwordpress ajax action urlwhat is my wordpress ajax urladmin url 28 27admin ajax php 27 29wordpress ajax page loadwordpress call a function with ajaxwordpress how to find ajax url javascriptajax link wordpresswordpress add action ajax urlwp url ajaxwordpress ajax sitewordpress route urlwordpress ajax request urladmin ajax urlfunctions php add ajaxget ajax admin page in jswordpress ajax url phpwordpress 24 post 28ajaxurl 2cdata 2cwp admin url in javascriptwordpress ajax url