SemicolonAcademy / ci-cms

Automatically exported from code.google.com/p/ci-cms
Other
0 stars 0 forks source link

add base_url in javascript #46

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
would be interesting to add the script

<script type="text/javascript">
       CI_ROOT = "<?=base_url() ?>";
</script>

thus can reach the base_url, as in the case of ajax login

$.post(CI_ROOT+"/member/ajax/login",{ username: username, password: 
password,rand:Math.random() } ,function(xml)

sorry for my english!

Greetings from Argentina

Original issue reported on code.google.com by lvitt...@gmail.com on 27 Aug 2010 at 10:48

GoogleCodeExporter commented 9 years ago
Hmm, you are right. Thanks.

But it seems to be template side isn't it? Ajax login can be put on template 
side and the script for CI_ROOT can be put in header.php or something like that.

I'll put it in the default template.

Original comment by heriniai...@gmail.com on 27 Aug 2010 at 11:17

GoogleCodeExporter commented 9 years ago
Yes, in header.php template
within <head> </ head>

Original comment by lvitt...@gmail.com on 28 Aug 2010 at 11:42