$ajax->Exec(“button1”,$ajax->call(“ajax.php?confirm/confirm_action”,null,“Are you sure?”));
where to put this code either view or controller file? if we put in the view file please demostrate in view file.
Preferably in the controller.
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
July 03, 2012 7:32pm
Subscribe [12]#16 / Jul 07, 2012 5:04am
$ajax->Exec(“button1”,$ajax->call(“ajax.php?confirm/confirm_action”,null,“Are you sure?”));
where to put this code either view or controller file? if we put in the view file please demostrate in view file.
Preferably in the controller.
#17 / Jul 07, 2012 5:05am
1. from where are you firing it?.
2. do you have mod-rewire enabled?
#18 / Jul 07, 2012 9:43am
When i used
response/alert.php
<?php
class controller_alert {
function fire_alert($message)
{
$ajax = ajax();
$ajax->alert($message);
}
}
//view file
[removed][removed]
<?php
$ajax = ajax();
$ajax->Exec(“anchor1”,$ajax->call(base_url().“ajax/alert/fire_alert/Hello”));
?>
Anchor 1
yes i have enable the mod_rewrite
i get the loading but i don’t get the hello message.
#19 / Jul 07, 2012 11:30am
edit:
are you Echoing $ajax->init() on the head tag?
For your other questions, the are better answer here: http://ajaxboy.com/2012/07/how-not-to-use-ajaxfw-three-things-you-should-avoid/
#20 / Jul 29, 2012 6:21pm
Hello, this is my very first day “playing” with CJAX and I am having a lot of troubles. I have solved most of them, but now, I am trying to pass the installation test and it breaks at “view2”. It gives me this error multiple times. How can I fix it?
I already changed to
call_user_func(array($class,'autoload'));This is what I get in the second step:
A PHP Error was encountered
Severity: Notice
Message: Use of undefined constant JSON_FORCE_OBJECT - assumed 'JSON_FORCE_OBJECT'
Filename: classes/core.class.php
Line Number: 746
A PHP Error was encountered
Severity: Warning
Message: json_encode() expects exactly 1 parameter, 2 given
Filename: classes/core.class.php
Line Number: 746
#21 / Jul 29, 2012 7:21pm
Hi Antonio,
Cjax is currently compatible with php 5.3, what version of php are you using?
#22 / Jul 30, 2012 2:57am
5.2.17 is my phpversion. I am using a 1and1 hosting.
#23 / Jul 30, 2012 3:00am
Yeah, as mentioned the current version of Cjax requires at least php 5.3+
#24 / Jul 30, 2012 3:05am
But, may it work properly with my version? Or should I use another CJAX version?
SOLVED.
#25 / Jul 30, 2012 8:37am
Hi, this is me again :D
I fixed the problem with my host. It is now running php 5.4.4. But I have some problems again.
A PHP Error was encountered
Severity: Warning
Message: Creating default object from empty value
Filename: classes/core.class.php
Line Number: 247
Cjax Works
version: 5.0-Stable
A PHP Error was encountered
Severity: Notice
Message: Array to string conversion
Filename: classes/core.class.php
Line Number: 382I get these errors. Some problem with configuration again? Or is it anything else?
Thank you so much.
#26 / Jul 30, 2012 11:26am
php 5.4 just came out, hence rarely used at the moment - hasn’t been tested either .... sign
Again, I can’t guarantee something that isn’t tested. However you are free to manually fix the warnings, These are likely just warnings but no guarantees.
#27 / Aug 20, 2012 11:23am
yes , i use v 5 no error appear on firebug
just no response came
Call executed. cjax-5.0-Stable.min.js:362
Waiting for response.. cjax-5.0-Stable.min.js:373
XHR finished loading: “domain/ajax.php?overlay/loadsubcustomers/28”.
url response is empty and that mean that ajax.php not call overlay controller on windows platform
#28 / Aug 20, 2012 11:26am
Are php errors turned on?, Try this:
ini_set(‘display_errors’, 1);
ini_set(‘log_errors’, 1);
#29 / Aug 20, 2012 11:37am
no error appear and firebug say that response have no data , it look like no controller hook done , but codeigniter index.php work normaly
#30 / Aug 20, 2012 12:28pm
after tracking code i found that error from this point
on ajaxfw.php
define(‘AJAX_CONTROLLER’,1);
require_once (dirname(__file__)).’/cjax/cjax.php’;
$ajax = CJAX::getInstance();
$controller = $ajax->input(‘controller’);
// self echo for controller dont print any name that mean that CJAX::getInstance(); input function dont return controller on windows iis
how to fix that ?
echo $controller;
if($controller) {
new ajax($controller);
}