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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -