使用Joomla的jRoute库时POST URL的问题


Issue with POST URL when using Joomla's jRoute library

我正在使用Joomla的jRoute库,当我需要这种类型的控制台URL时,我的控制台请求URL Post http://localhost/jfirst/index.php/en/hospital Post http://localhost/jfirst/

function get_state(e) {
    $js.ajax({
        url: "<?php JRoute::_('') ?>",
        type: "POST",
        dataType: 'json',
        data: {
            'option': 'com_doctors',
            'view': 'hospital',
            'task': 'get_state',
            'id': e
        },
        beforeSend: function() {

        },
        success: function(res) {
            $js('#city').html(res.html);
        },
        error: function() {
            alert('error');
        }
    });
}

尝试使用<?php JRoute::_('index.php') ?>

我自己找到了问题,我使用了URL:",并且工作正常。