Opencart - Way to call ajax request in Admin Panel
<p>I want to fetch some data using ajax request in Opencart Admin panel. I have simply created a controller which only returns data in json format. Using below code:</p>

<pre><code>$.ajax({
    type: 'post',
    url: 'index.php?route=common/ajaxdata/functionName&amp;token=&lt;?php echo $token; ?&gt;',
    data: data,
    dataType: 'json',
    success: function(json) {
        if (json['success']) {
            alert(json['success']);
        }
    }
 });
</code></pre>

<p>Can anybody please let know whether this is correct or any other built in functionality available in Opencart for ajax requests? So that I can proceed and implement this in my rest of the pages.</p>

<p>Thanks</p>