Saturday, May 21, 2016

WordPress get ajax full url

In Wordpress we can get the full Ajax url as follows:

In PHP we can get it in the following way.

<?php echo admin_url('admin-ajax.php'); ?>

If you want to use it in Javascript then you can use it in following way.

<script type="text/javascript">
    var ajaxurl = "<?php echo admin_url('admin-ajax.php'); ?>";
</script>


No comments:

Post a Comment

MS SQL : How to identify fragmentation in your indexes?

Almost all of us know what fragmentation in SQL indexes are and how it can affect the performance. For those who are new Index fragmentation...