Access Ajax request data

127 views Asked by At

can you help me please?

-- I've making ajax call to partial and sending the data ( productId )

$.request('onProductLoad', { data: {'productId': 22}, update: { 'Product/card': #result} })

how i can access this data in function onProductLoad() in the php code tab on a page that partial is placed in.

Thank you!

1

There are 1 answers

0
Raja Khoury On

Add a function called onProductLoad to the page and you can access the posted data as you would normally do in a component.

title = "My Page"
url = "/"
layout = "default"
==
<?
function onProductLoad()
{
    $productId = post('productId');
}
?>
==