accessing php page by ajax.. - Joomla! Forum - community, help and support
from main page of component call page ajax.php jquery ajax.but @ first problem adding following lines solved -
error_reporting(0); ini_set('display_errors', false);
define('_jexec', 1); defined('_jexec') or die("restricted access");
but problem jpath_base,juri..... classes not working in ajax.php when called ajax!. same behaviour when submit form page.
please experts
error_reporting(0); ini_set('display_errors', false);
define('_jexec', 1); defined('_jexec') or die("restricted access");
but problem jpath_base,juri..... classes not working in ajax.php when called ajax!. same behaviour when submit form page.
please experts
in controller:
jquery ajax:
code: select all
public function ajaxtask()
{
$app = &jfactory::getapplication();
//some actions ....
//return result
$app->close();
}
jquery ajax:
code: select all
jquery.ajax({
url: "index.php", // send request index.php, not ajax.php
data:
{
option: "com_yourcomponent",
task: "controller.ajaxtask",
// variblies
},
success: function(data)
{
// ...
}
});
Comments
Post a Comment