Answer Posted / Amardeep Kumar Pandey
1. Create an AJAX function in your JavaScript file (e.g., `menu.js`).
2. In the AJAX function, make an AJAX request using jQuery (assuming you have included it) to a Yii controller action that returns JSON data:
```
$.ajax({
url: 'url-to-controller-action',
type: 'POST' or 'GET',
success: function(response) {
// handle response
}
});
```
3. Ensure that the controller action returns JSON data and sends the appropriate content-type header.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers