php - How can I get the param passed in an URL in JavaScript -
i have datatables , want param id 194 out of url
admin/customer-management/updater/id/194
my source ajax:
"sajaxsource": "/<?= zend_registry::get('zend_locale')->getlanguage(); ?>/admin/customermanagement/getlistcontactsajax/idcustomer/" + $(this).attr('value');
i + $(this).attr('value');
not work.
visibly, use php (with zend) write js code.
can recover id in controller :
$id = $this->getrequest()->getparam('id');
so can write js code (may pass variable in view):
"sajaxsource": "/<?=zend_registry::get('zend_locale')->getlanguage();?>/admin/customermanagement/getlistcontactsajax/idcustomer/<?= $id?>",
Comments
Post a Comment