Topic: XAJAX_CALLABLE_OBJECT and namespace

Hy i'm trying to use xAjax in zf2 project. I'm want register an object with collection of xajax response method.

For this i'm try :

  $xajax->register(XAJAX_CALLABLE_OBJECT,$this->XajaxPlugin());

But with this with namespace i've with printJavascript() :

/* <![CDATA[ */
xajax_Test\Controller\Plugin\XajaxPlugin = {};
xajax_Test\Controller\Plugin\XajaxPlugin.coucou = function() { return xajax.request( { xjxcls: 'Test\Controller\Plugin\XajaxPlugin', xjxmthd: 'coucou' }, { parameters: arguments } ); };
xajax_Test\Controller\Plugin\XajaxPlugin.setController = function() { return xajax.request( { xjxcls: 'Test\Controller\Plugin\XajaxPlugin', xjxmthd: 'setController' }, { parameters: arguments } ); };
xajax_Test\Controller\Plugin\XajaxPlugin.getController = function() { return xajax.request( { xjxcls: 'Test\Controller\Plugin\XajaxPlugin', xjxmthd: 'getController' }, { parameters: arguments } ); };
/* ]]> */

And if i'm write :

<button onclick="xajax_Eridufront\Controller\Plugin\XajaxPlugin.coucou('It worked!');">

i've a javascript error because '\' doesn't work sad

Re: XAJAX_CALLABLE_OBJECT and namespace

The backslashes in your onclick need to be escaped. i.e. \ should be \\.

Not sure if this will fix it but it may be worth a try...

If you ever stop learning you may as well dig a hole, crawl in and pull the top over yourself.

Re: XAJAX_CALLABLE_OBJECT and namespace

Yes i'm testing that but it doesn't fix.

Finally i'm writing a php file without namespace and i'm require this in my controller. And I'm call that with

    $xajax->register(XAJAX_CALLABLE_OBJECT, new \libajax($sm) )

Really funny because i'm give ServiceLocator of my ZF2 application in my libajax classes.