I am trying sajax, and as you said, I made those variables globals, and it... works.... and maybe POST is better, because I saw that if u set GET, sajax write some header stuff which I don’t really like:P.... maybe because I don’t understand...
I wrote in the php document of modx:
$GLOBALS['sajax_request_type'] = "POST";
$GLOBALS['sajax_debug_mode'] = 0;
$GLOBALS['sajax_remote_uri'] = sajax_get_my_uri();//$_SERVER['REQUEST_URI'];
and it worked....
and I made some modifications to have sajax_target_id variable available from php code exactly as those I mentioned before....
[tt]sajax_target_id[/tt] was made to put the results of the server ajax function directly in an DOM element, through javascript, but [tt]sajax_target_id[/tt] is not available by default as the others variables.... to set it, you must go to the code of the [tt]sajax_get_common_js()[/tt] function to modify it, and is nasty this way....
so the modifications are as follows:
1. in your php code, near the other globals, add the one with [tt]sajax_target_id[/tt]
$GLOBALS['sajax_request_type'] = "POST";
$GLOBALS['sajax_debug_mode'] = 0;
$GLOBALS['sajax_remote_uri'] = sajax_get_my_uri();//$_SERVER['REQUEST_URI'];//$modx->makeUrl($modx->documentIdentifier);
$GLOBALS['sajax_target_id'] = "";
2. in the Sajax.php add this line, at the beginning of the file, near the other globals:
$GLOBALS['sajax_target_id'] = "";
3. in the Sajax.php, in the [tt]sajax_get_common_js()[/tt] function, add this line near the other globals:
[tt]global $sajax_target_id;[/tt]
4. in the same function, around line 261, replace [tt]innerHTML[/tt] with [tt]value[/tt] . Mysterious
reasons, I didn’t understand them, but with [tt]value[/tt] it works.....
...and it should work:P