Skip to content

Instantly share code, notes, and snippets.

@garyc40
Created October 3, 2012 15:00
Show Gist options
  • Save garyc40/3827400 to your computer and use it in GitHub Desktop.
Save garyc40/3827400 to your computer and use it in GitHub Desktop.
wp_enqueue_script() and wp_localize_script() HTML output
<script type="text/javascript" src="http://example.com/wordpress/wp-content/plugins/myajax/js/ajax.js"></script>
<script type="text/javascript">
/* <![CDATA[ */
var MyAjax = {
ajaxurl: "http://example.com/wordpress/wp-admin/admin-ajax.php"
};
/* ]]> */
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment