Xajax 0.2: Tips and Tricks: Upgrading to xajax 0.2






Xajax 0.2: Tips and Tricks: Upgrading to xajax 0.2

[edit] Request Types

If you pass variables via GET. You have to change all your function registrations from this:

$xajax->registerFunction("myPhpFunction"GET);

to this:

$xajax->registerFunction("myPhpFunction"XAJAX_GET);

--Rene

[edit] Include Path

If you get this javascript error message:

Error: xajax is not defined

and you store xajax somewhere other than ./xajax you'll need to pass the path where it can be found to the printJavascript function.

Change this:

$xajax->printJavascript();

To this:

$xajax->printJavascript("/javascript_libraries/xajax/");

[edit] Disabled form fields

If you are wondering why, after upgrading, some form values will no longer be passed to your response function using

xajax.getFormValues('formname')

you should check for disabled form elements. If you need to submit disabled form elements, change the call for getFormValues() to

xajax.getFormValues('formname',true)