<script type="text/javascript">
CI_ROOT = "<?php echo(base_url());?>";
</script>
With base_url you get the root url of your website.
2. Use the CI_ROOT in any js file to get the root url.
For example, in a jquery - ajax call:
...
$.post(CI_ROOT + 'bookings/updBooking_ByAjax', data, function(res){
alert(res);
...