Public Method Details
|
AjaxCore
|
public void AjaxCore( [ boolean $lastbind ] )
|
|
AjaxCore()
Class constructor.
|
Parameter |
|
boolean |
$lastbind |
= >>false<< |
|
it's the name of the last JavaScript event triggered. |
|
Returns |
void
|
|
setJSCode
|
public void setJSCode( string $id, string $before, string $after )
|
|
setJSCode
Sets specific JavaScript code to execute before and after the AJAX request is made.
|
Parameter |
|
string |
$id |
|
|
HTML object id |
|
|
string |
$before |
|
|
JavaScript code to execute before the AJAX request is being made. |
|
|
string |
$after |
|
|
JavaScript code to execute before the AJAX request is being made. |
|
Returns |
void
|
|
setDebug
|
public void setDebug( bool $debug )
|
|
setDebug
Set whether it should print JavaScript error when occurrs.
|
Parameter |
|
bool |
$debug |
|
|
boolean value. |
|
Returns |
void
|
|
getJSCode
|
public void getJSCode( )
|
|
getJSCode
Returns string header JavaScript code for main placeHolder.
|
Returns |
void
|
|
bind
|
public string bind( string $id, string $event, string $bindto, [ string $params ]
)
|
|
bind
Does the bind between an Html object and PHP function, request will be made when
appropiate JavaScript event is triggered.
|
Parameter |
|
string |
$id |
|
|
Html ID object |
|
|
string |
$event |
|
|
JavaScript event that will cause AJAX request ( onfocus onblur onmouseover onmouseout
onmousedown onmouseup onsubmit onclick onload onchange onkeypress onkeydown onkeyup
) |
|
|
string |
$bindto |
|
|
PHP function that handles the AJAX request |
|
|
string |
$params |
= >>""<< |
|
ID of the Html elements that needs to be send within the request, static values
(not html elements ) should be sent as _XXX=YYY , whether XXX represents variable
name, and YYY value. |
|
Returns |
string
JavaScript code to handle the binding.
|
|
onLoad
|
public string onLoad( string $bindto, [ string $params, string $request, integer
$timerms ] )
|
|
onLoad
Does a request to a PHP function, request will be made when onLoad JavaScript event
occurs.
|
Parameter |
|
string |
$bindto |
|
|
PHP function that handles the AJAX request |
|
|
string |
$params |
= >>""<< |
|
ID of the Html elements that needs to be send within the request, static values
(not html elements ) should be sent as _XXX=YYY , whether XXX represents variable
name, and YYY value. |
|
|
string |
$request |
= >>"bind"<< |
|
type of request, bind, bindTimer, bindPeriodicalTimer |
|
|
integer |
$timerms |
= >>300<< |
|
timer expiration time in milliseconds (only for timer requests) |
|
Returns |
string
JavaScript code to handle the binding.
|
|
bindTimer
|
public string bindTimer( string $id, string $event, string $bindto, string $timername,
string $timerms, [ string $params ] )
|
|
bindTimer
Does the bind between an Html object and PHP function, request will be made when
onLoad JavaScript event occurs and timer expires.
|
Parameter |
|
string |
$id |
|
|
Html ID object |
|
|
string |
$event |
|
|
JavaScript event that will cause AJAX request ( onfocus onblur onmouseover onmouseout
onmousedown onmouseup onsubmit onclick onload onchange onkeypress onkeydown onkeyup
) |
|
|
string |
$bindto |
|
|
PHP function that handles the AJAX request |
|
|
string |
$timername |
|
|
ID of the Html elements that needs to be send within the request, static values
(not html elements ) should be sent as _XXX=YYY , whether XXX represents variable
name, and YYY value. |
|
|
string |
$timerms |
|
|
name of the timer |
|
|
string |
$params |
= >>""<< |
|
expiration time in milliseconds |
|
Returns |
string
JavaScript code to handle the binding.
|
|
bindPeriodicalTimer
|
public string bindPeriodicalTimer( string $id, string $event, string $bindto, string
$timername, string $timerms, [ string $params ] )
|
|
bindPeriodicalTimer
Does the bind between an Html object and PHP function, request will be made when
onLoad JavaScript event occurs and will keep repeating when timer expires.
|
Parameter |
|
string |
$id |
|
|
Html ID object |
|
|
string |
$event |
|
|
JavaScript event that will cause AJAX request ( onfocus onblur onmouseover onmouseout
onmousedown onmouseup onsubmit onclick onload onchange onkeypress onkeydown onkeyup
) |
|
|
string |
$bindto |
|
|
PHP function that handles the AJAX request |
|
|
string |
$timername |
|
|
ID of the Html elements that needs to be send within the request, static values
(not html elements ) should be sent as _XXX=YYY , whether XXX represents variable
name, and YYY value. |
|
|
string |
$timerms |
|
|
name of the timer |
|
|
string |
$params |
= >>""<< |
|
expiration time in milliseconds |
|
Returns |
string
JavaScript code to handle the binding.
|
|
phpArrayToJS
|
public string phpArrayToJS( array $array )
|
|
phpArrayToJS
Converts an array from php to JavaScript.
|
Parameter |
|
|
Returns |
string
JavaScript array
|
|
startTimer
|
public void startTimer( string $id )
|
|
startTimer
Restarts a timer
|
Parameter |
|
string |
$id |
|
|
is the timer id |
|
Returns |
void
|
|
stopTimer
|
public void stopTimer( string $id )
|
|
stopTimer
Stops a timer
|
Parameter |
|
string |
$id |
|
|
is the timer id |
|
Returns |
void
|
|