AJASON
Home | Downloads | Getting Started | Options | Examples | Character Encoding | Bugs
Digg it    del.icio.us    Blink it

Options
The behaviour of AJASON can be tweaked via several options which are set by the setOption() method of the Ajax class. This method takes two arguments. The first argument is the kind of option, the second argument is the value. Valid options are:

Option Possible values Default value Description
Ajax::MethodOption Ajax::MethodPost, Ajax::MethodGet Ajax::MethodPost Set whether server requests will send data via POST or GET method
Ajax::HandlerOption string none, current PHP script Filename of PHP script which handles server requests
Ajax::DebugOption true, false false Show debug information on client for every AJAX request
Ajax::DisplayErrorsOption true, false true Display critical errors on client
Ajax::PrependOption string "x_" String which will be prepended to every function/class name within JavaScript
Ajax::EncodeOption true, false false Encode return value to UTF-8 before sending to client, see note

Use getOption() to read an option.
	$ajax->setOption( Ajax::MethodOption, Ajax::MethodGet );
	$ajax->setOption( Ajax::HandlerOption, "server.php" );
	$ajax->setOption( Ajax::DebugOption, true );
	
	$currentPrepend = $ajax->getOption( Ajax::PrependOption );