Last active
January 26, 2017 02:44
-
-
Save sanPuerquitoProgramador/26e01827040d232c698b884474cfd1f6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* simple snippet for create Code Igniter base_url() and site_url() in JavaSCript */ | |
<script type="text/javascript"> | |
var js_site_url = function( urlText ){var urlTmp = "<?php echo site_url('" + urlText + "'); ?>";return urlTmp;} | |
var js_base_url = function( urlText ){var urlTmp = "<?php echo base_url('" + urlText + "'); ?>";return urlTmp;} | |
</script> | |
/* e.g. use in js in the same way use in PHP Code Igniter*/ | |
<script> | |
js_site_url('main/ajaxcall'); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment