Hide navigator
Hide source code
Register a handler to be called when Ajax requests complete. This is an Ajax Event.
<?php include_once 'ajax.php';?>
<div>
<input type="button" value="Get Data" class="ajaxTrigger" />
<div style="color:blue" id="logForAjaxStart">
</div>
<?php
echo
YsJQuery::ajaxStart()
->in('#btnAjax')
->handler(
YsJQuery::html()->in('#logForAjaxStart')->value('On ajax start')
)
->executeOnReady();
?>
</div>
<div>
<input type="button" value="Get Data" id="btnAjax" />
<?php $prueba = YsJQueryCore::serialize()->in('prueba');?>
<?php
echo
YsJQuery::newInstance()
->onClick()
->in('#btnAjax')
->execute(
YsJQuery::ajax()
->_url('examples/response/ajaxResponse.php')
->_async(false)
->_data($prueba)
->_success(
new YsJsFunction('alert(response)','response')
)
)
?>
</div>
<?php
echo
YsJQuery::newInstance()
->onClick()
->in('.ajaxTrigger')
->executeOnReady(
YsJQuery::triggerHandler()->in('#btnAjax')
->eventType(YsJQueryConstant::CLICK_EVENT)
)
?>
Support requests, bug reports, and off-topic comments will be deleted without warning.