Error: the xajax Javascript component could not be included

Hi all,

Man, I have tested this problem in every way and with every browser and configuration I can think of - and no luck. I could really use some guidance on this if possible. Any help would be very much appreciated.

My problem is with including the xajax_core.js file in my application. I'm working in a fairly complex CodeIgniter framework, but in order to try to isolate this problem I created a simple test page and am still getting:

Error: the xajax Javascript component could not be included. Perhaps the URL is incorrect?
URL: res/xajax_js/xajax_core.js

This happens if I set the $xajax->configure('javascript URI', 'res/') variable to the absolute path, the relative path, the http path, etc. I've checked permissions, moved the folder and even tested that I could open the file in a browser. No luck.

I'm running Apache 2.2.15 and PHP 5.3.3 in case that might matter. Also using CI 2.1.2 and xajax 0.6

Here is my test page (taken from another post in this forum which seemed to deal with the same issue):

* 2012-01-19 Ed
* Simple xajax demo page

include 'system/libraries/xajax/xajax_core/xajax.php';
$xajax = new xajax();
$xajax->configure('javascript URI', 'res/');

function favoris($user,$fav,$add)
    //let's say there's a sql request here. OK
    if($add) //if we add
        $text='Added to your favorites.';
        $text='Removed from your favorites.';
    $objResponse = new xajaxResponse();
    $objResponse->assign('favoris2', 'innerHTML', $text); //So we put $text in <div id="favoris"></div> right?
    return $objResponse;

$xajaxjs = $xajax->getJavascript(); //Loads the js into the variable

<!DOCTYPE html>
&lt;title&gt;Xajax Sample&lt;/title&gt;
&lt;?php echo $xajaxjs; ?&gt;
<div id="favoris">
<button>Add Favorite</button>
<button>Remove Favorite</button>
<div id="favoris2"></div>

The script does find the file 'xajax.php' but then fails to located the xajax_js folder.

Please help!


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.