jQuery AJAX post request issue - cannot get to root directory

$.post("./ajax.php", { action: "formID", firstname: firstname_val, email: email_val })

The ajax.php file works but only from the homepage etc..

Can anyone suggest why this isn't going to the file directly in the root? In other parts of the site it appends the current url eg /page/ajax.php.

Answers


Take the dot out from before the slash:

$.post("/ajax.php", { action: "formID", firstname: firstname_val, email: email_val },

Need Your Help

Slow Responsiveness MySql

mysql innodb semaphore

I have fired a command SHOW ENGINE INNODB STATUS; in mysql for detecting slowness in response, following is the stacktrace of Semaphore, but as I am new to this, so can't figure out statistics, pl...

Names for database tables like t1,t2,t3 etc

java sql database-design mybatis

We have the following situation - we have framework with which different developers can work and who don't know about other developers. And we have a customer who can take extensions (ebj osgi bund...