Welcome Guest, Not a member yet? Register   Sign In
Ajax question: Why do I need index.php in the path?
#5

[eluser]wowdezign[/eluser]
Quote:If I use $.ajax({
url: “jquery/ajaxprocess”,...

instead of
url: “index.php/jquery/ajaxprocess”,
or
url: “/jquery/ajaxprocess”,

It works. I hope I am doing a right thing.

If you have your configuration set up correctly, you should be able to use:

Code:
<?php echo site_url('jquery/ajaxprocess');?>

site_url() should know all that if you are writing the path from PHP.

If you are trying to use it in a JavaScript file, I usually set a baseURL Javascript variable in the head of my page using:
Code:
[removed]
var baseURL = <?php echo site_url(); ?>;
[removed]

Then inside my js files, I can use that variable to build up absolute URLs.


Messages In This Thread
Ajax question: Why do I need index.php in the path? - by El Forum - 01-07-2010, 10:27 AM
Ajax question: Why do I need index.php in the path? - by El Forum - 01-07-2010, 10:31 AM
Ajax question: Why do I need index.php in the path? - by El Forum - 01-07-2010, 12:43 PM
Ajax question: Why do I need index.php in the path? - by El Forum - 01-07-2010, 01:34 PM
Ajax question: Why do I need index.php in the path? - by El Forum - 01-07-2010, 01:37 PM
Ajax question: Why do I need index.php in the path? - by El Forum - 01-07-2010, 01:39 PM



Theme © iAndrew 2016 - Forum software by © MyBB