loading data from server with codeigniter

I have a couple of scheduler page with different purposes, and all the data are referring from a function called ‘cal’ inside a controller named ‘main’

in scheduler1.php (view), I have this code:

scheduler.load("cal/<?php echo $selRoom; ?>"); var dp = new dataProcessor("cal/<?php echo $selRoom; ?>");

in scheduler2.php (view), I have this code because when I only write ‘cal’ like schedule1, it won’t appear:

scheduler.load("<?php echo base_url();?>/index.php/main/cal/<?php echo $selRoom; ?>"); var dp = new dataProcessor("<?php echo base_url();?>/index.php/main/cal/<?php echo $selRoom; ?>");

in scheduler3.php(view), I’ve tried both ways like above, but none of that works.

Why is that?

The client side doesn’t care what is the path string, while it points to the valid end point.
Beware that when you starting path like in the first case - it will be a relative path, which can be different for different url patterns. In second case, the full http path must work for all cases equally well, but be sure that it leads to the same domain ( in other case data will be blocked due to cross domain security rules )