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
精彩评论