Welcome Guest, Not a member yet? Register   Sign In
External JS with CI / PHP
#7

[eluser]Maglok[/eluser]
[quote author="mjstenbe" date="1268848621"]Thanks for the input Simon. This doesnt solve the problem though.

The problem being <?php echo base_url();?> - statement in the external JS file. And thus the function not working properly. Placed in the PHP file this works fine. See an example below.


Code:
$.ajax({
        type: "POST",
        url: "<?php echo base_url();?>index/test/delete",
        data: data,
        success: function(msg) {
   // // //
   });
Is it really the case, that in order to use JS with PHP, it has to be contained within the same file?

Thanks,
Mika[/quote]

You did mention that you put it inside the CI dir at first, that should not work by default. Smile But yes define constant in the head, e voila.


Messages In This Thread
External JS with CI / PHP - by El Forum - 03-17-2010, 05:57 AM
External JS with CI / PHP - by El Forum - 03-17-2010, 06:22 AM
External JS with CI / PHP - by El Forum - 03-17-2010, 06:57 AM
External JS with CI / PHP - by El Forum - 03-17-2010, 07:05 AM
External JS with CI / PHP - by El Forum - 03-17-2010, 07:13 AM
External JS with CI / PHP - by El Forum - 03-17-2010, 07:25 AM
External JS with CI / PHP - by El Forum - 03-17-2010, 07:30 AM
External JS with CI / PHP - by El Forum - 03-17-2010, 09:21 PM
External JS with CI / PHP - by El Forum - 03-18-2010, 12:30 AM



Theme © iAndrew 2016 - Forum software by © MyBB