Skip to content

Instantly share code, notes, and snippets.

@everdaniel
Created July 7, 2013 16:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save everdaniel/5943969 to your computer and use it in GitHub Desktop.
Save everdaniel/5943969 to your computer and use it in GitHub Desktop.
JS Config Object in Header / CodeIgniter
<script type="text/javascript">
/* <![CDATA[ */
// Global My App Namespace
window.myapp = window.myapp || {};
// AJAX Namespace
myapp.ajax = myapp.ajax || {};
myapp.ajax.csrf = '98dd0f785e';
myapp.ajax.paths = {
endpoint_1: 'http://myapp.127.0.01.xip.io/ajax/endpoint1',
endpoint_2: 'http://myapp.127.0.01.xip.io/ajax/endpoint2',
endpoint_3: 'http://myapp.127.0.01.xip.io/ajax/endpoint3'
}
/* ]]> */
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment