wp_localize_script adds a backslash | admin-ajax.php
-
wp_localize_script('cb_ajax_request', 'cbAjax', array('ajaxurl' => admin_url('admin-ajax.php')));
And this how it looks when I do a view the page source:
<script type='text/javascript'> /* <![CDATA[ */ var cbAjax = {"ajaxurl":"http:\/\/subdomain.mysite.com\/wp-admin\/admin-ajax.php"}; /* ]]> */ </script>
Here is a example I tried out. Just trying #1.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘wp_localize_script adds a backslash | admin-ajax.php’ is closed to new replies.