开发者

IE doesn't receive data via jQuery.post

开发者 https://www.devze.com 2023-04-06 13:21 出处:网络
i`ve fa开发者_运维技巧ced some strange problem. jQuery.post fails silently only in IE, other browsers get information.

i`ve fa开发者_运维技巧ced some strange problem. jQuery.post fails silently only in IE, other browsers get information.

jQuery.post(
        'index.php',
        {
            'option'    : 'com_expautos',
            'controller': 'admanager',
            //'dataType'  : 'text',
            'task'      : 'get_'+name,
            'id'        : parent.val(),
        },
        function(data) {
            //alert(data);
            item.html(data);
            item.attr('disabled', '');
        }
    ); 

PHP

function get_markid() {
        $id     = JRequest::getInt('id', 0);
        $db     = &JFactory::getDBO();
        $items  = array();
        $null_item = JHTML::_('select.option',  '', JText::_( 'EXPA_SELECT_MARK' ), 'id', 'name' );

    if ( $id ) {
        $sql    = "SELECT id, name
            FROM #__expautos_mark
            WHERE catid = '".$id."' AND published = '1'
            ORDER BY name";
        $db->setQuery($sql);
        $items  = $db->loadObjectList();
    }

    array_unshift( $items, $null_item );

    echo JHTML::_('select.options',  $items, 'id', 'name' );

    $mainframe  = &JFactory::getApplication();
    $mainframe->close();

}

jQuery.get fails too. I am in despair :(


        {
            'option'    : 'com_expautos',
            'controller': 'admanager',
            //'dataType'  : 'text',
            'task'      : 'get_'+name,
            'id'        : parent.val(), // <--
        }

IE doesn't like commas at the end of a json. Maybe that's the problem

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号