I have the following code:
$this->Js->get('#get_meters_today')->event('click',
$this->Js->request(
array('action' => 'getMetersToday'),
array('async' => true, 'update' => '#meters_today')
)
);
$this->Html->scriptBlock(
$this->Js->domReady(
$this->Js->request(
array('action' => 'getMetersToday'),
array('async' => true, 'update' => '#meters_today')
)
), array('inline' => false)
);
what I want to do is just have the Js->request
written once and referred to by the click
method and the domReady
method. How do I do this?
Thanks