Topic: Miracle with xAjax 0.5
I use xAjax 0.5 and develop a component to CMS Joomla 1.5
I have surprisings, and not clear for me situations.
In the same component, I connect treatment through xAjax 0.5 - use the same code (a code is absolutely identical) on a few pages of component.
In one case (on one page) a code is worked off, on other page I get an error:
ERROR: No response processor is available to process the response from the server.
Content-Type: text/html; charset=utf-8
In addition, when I look in xajax debug output, I see that in case with an error the Source code of my main page of site returns in RECEIVED.
I know that it and there is reason of error, but I can not find an error because does not understand why the same code works not identically...
==== file umcitajax.init.php =================
Code: PHP
require_once (JPATH_COMPONENT_ADMINISTRATOR.DS."library".DS."xajax".DS."xajax_core".DS."xajax.inc.php") ;
$xajax = new xajax();
$xajax->configure('debug',true);
$xajax->configure('javascript URI','../administrator/components/com_umcit/library/xajax/');
$xajax->register(XAJAX_FUNCTION,new xajaxUserFunction('listEnterpForMedical',JPATH_COMPONENT_ADMINISTRATOR.DS.'/classes/umcitajax.func.php'));
==== file umcitajax.func.php =======(Starts the first)==========
Code: PHP
function listEnterpForMedical($idMedical=0)
{
$db =& JFactory::getDBO();
$query='SELECT tableRelation.id AS `id`, tableRelation.start_date AS `start_date`, tableRelation.end_date AS `end_date`, tableRelation.id_enterprise AS `id_enterprise`, tableRelation.date_insert AS `date_insert`, tableEnterprise.name AS `short_name` FROM #__umcit_relation_enterprise_of_medical AS tableRelation LEFT JOIN #__umcit_enterprise AS tableEnterprise ON tableEnterprise.id = tableRelation.id_enterprise WHERE tableRelation.id_medical='.$idMedical;
$db->setQuery($query);
$rows = $db->loadObjectList();
$output='';
if ( empty($rows)) {
$output='<tr><td colspan="3" nowrap="nowrap" align="center" valign="center" bgcolor="ffffff" style="BORDER-RIGHT: rgb(0,0,0) 1px solid; BORDER-BOTTOM: rgb(0,0,0) 1px solid">Нет данных для отображения</td></tr>';
} else {
foreach ($rows as $k => $row) {
$name = $row->short_name;
$start_date = $row->start_date;
$end_date = $row->end_date;
$output .='<tr><td align="left" valign="center" bgcolor="ffffff" style="BORDER-RIGHT: rgb(0,0,0) 1px solid; BORDER-BOTTOM: rgb(0,0,0) 1px solid">'.$name.'</td>';
$output .='<td align="center" valign="center" bgcolor="ffffff" style="BORDER-RIGHT: rgb(0,0,0) 1px solid; BORDER-BOTTOM: rgb(0,0,0) 1px solid">'.$start_date.'</td>';
$output .='<td align="center" valign="center" bgcolor="ffffff" style="BORDER-RIGHT: rgb(0,0,0) 1px solid; BORDER-BOTTOM: rgb(0,0,0) 1px solid">'.$end_date.'</td></tr>';
}
}
$objResponse = new xajaxResponse();
$objResponse->assign("listEnt","innerHTML",$output);
return $objResponse;
}
require (JPATH_COMPONENT_ADMINISTRATOR.DS.'/classes/umcitajax.init.php');
$xajax->processRequest();
==== in file templdefault.php =================
Code: PHP
echo $xajax->printJavascript();
>>>>>>> ........ <<<<<<<<
<div id="listEnt"> </div>
<input type="button" class="button" value="Медработники" onclick="xajax_listEnterpForMedical(1);" />
***This code is used on one and on other page, nothing changes, one is simply caused and also from differentpages.
==== Source code of page =================
Code: PHP
/* <![CDATA[ */
try { if (undefined == xajax.config) xajax.config = {}; } catch (e) { xajax = {}; xajax.config = {}; };
xajax.config.requestURI = "http://mps.domain.com.ua/administrator/ er=medical";
xajax.config.statusMessages = false;
xajax.config.waitCursor = true;
xajax.config.version = "xajax 0.5";
xajax.config.legacy = false;
xajax.config.defaultMode = "asynchronous";
xajax.config.defaultMethod = "POST";
/* ]]> */
</script>
<script type="text/javascript" src="../administrator/components/com_umcit/library/xajax/xajax_js/xajax_core.js" charset="UTF-8"></script>
<script type="text/javascript" src="../administrator/components/com_umcit/library/xajax/xajax_js/xajax_debug.js" charset="UTF-8"></script>
=======
<script type='text/javascript' charset='UTF-8'>
/* <![CDATA[ */
xajax_listEnterpForMedical = function() { return xajax.request( { xjxfun: 'listEnterpForMedical' }, { parameters: arguments } ); };
/* ]]> */
</script>
======================================================
Please, prompt ot what such can take place ???