替代innerHTML for ie(Internet Explorer

时间:2012-08-02 15:28:39

标签: php internet-explorer select innerhtml xajax

  

可能重复:
  innerHTML working in FF but not in IE!
  innerHTML in IE?

我在XAJAX注册函数中使用innerHTML来动态构建SELECT标记。 该函数在FIREFOX,CHROME和SAFARI中正常工作,但它在IE中不起作用。是否有替代使用innerHTML在IE中使其工作? 以下是该功能的列表:

function getProducts($category_sname)
 {
    global $current_item_id;
    /*** a new xajax response object ***/
    $objResponse=new xajaxResponse();
    $objResponse->script("clearOption('item_identification');");

    $category_name = substr($category_sname,1,39);
                $cat_list = Jelly::select('catmst')
                        ->select('category_identification','name')
                        ->and_where('name','=',$category_name)
                        ->deleteflag()
                        ->execute();

                foreach ($cat_list as $catl)
                {
                        $category_id = $catl->category_identification;
                }
    /*** get the item_identification data ***/
    $OL=array();
    $OL=getProductData($category_id);

    /*** set first value ***/
    $ret = '<option value="">Select One</option>';
    foreach ($OL as $value => $text)
    {
        /*** the product dropdown options ***/
    $ret .= '<option value="'.$value.'">'.$text.'</option>';
    }
    /*** assign the options to the item_identification div ***/
    $objResponse->assign('item_identification', 'innerHTML', $ret);
    return $objResponse;
 }

1 个答案:

答案 0 :(得分:0)

http://support.microsoft.com/kb/276228

中描述了在DOM模型中处理<select>元素的更便携方式