Talk:Xajax 0.2: Tips and Tricks: Overriding the xajax javascript






Talk:Xajax 0.2: Tips and Tricks: Overriding the xajax javascript

Hello,

I'm using xajax at work and i'm struggling, trying to make something working...

I would like to display a red square on the top left of the screen when a xajax function is called.

I did a div called 'spinner' with that css:

and I added a function in another function ... like that:


function MyBigHugeFunction($arg)
    {
    displayspinner("on");
    ... ... ... // some php who took some seconds to display
    displayspinner("off");
    $reponse = new xajaxResponse();
    $reponse->addAssign("Container","innerHTML", "$html");
    return $reponse;
    }


function displaysplinner($switch)
    {
    $reponse = new xajaxResponse();
    if ($switch=="on")
        {
        $html = "Loading...";
        }
    else
        {
        unset($html);        
        }
    $reponse->addAssign("spinner","innerHTML", "$html");
    return $reponse;
    }

then I register both functions

$xajax = new xajax();
$xajax->registerFunction("MyBigHugeFunction");
$xajax->registerFunction("displayspinner");
$xajax->processRequests();

and that still do not work...

What am I doing wrong?

I have tried the trick by overriding the xajax javascript but I would like to find a smarter way to do that without adding javascript... Is it possible ?

Thanks for all

[edit] Forum

hi, you better ask questions in the forum! http://community.xajaxproject.org/index.php