AJAX is a way updating parts of a web page without reloading the whole web page by exchanging data with a server.Creating AJAX calls in typo3 extensions.
AJAX is a way updating parts of a web page without reloading the whole web page by exchanging data with a server.
TYPO3 has some features that allow you to easily combine AJAX with TYPO3.
1. Making an AJAX request.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | $(document).ready(function() { $('#target_id').click(function(){ $.ajax({ url: 'index.php', data: { eID: 'ediName', tx_ediNameajax_pi1: ({ 'value': $('#target_value').val() }) }, success: function(data) { //Somethinf to do. } }); return false; }); }); |
2. $TYPO3_CONF_VARS[‘FE’][‘eID_include’][‘ediName’] = ‘EXT:ext_name/pi1/ajaxRequestHandler.php’;
Add the above configuration inside your typo3 extension ext_localconf.php. This meens that ‘ajaxRequestHandler.php’ will be used when ‘ediName’ is called.
3. In ‘ajaxRequestHandler.php’ we can access the ‘value’ parameter like this :
1 2 | $piVars = t3lib_div::_GP('tx_ediNameajax_pi1'); value = $piVars['value']); |