【问题标题】:Alternative to innerHTML for ie (Internet Explorer [duplicate]替代innerHTML for ie(Internet Explorer [重复]
【发布时间】:2012-08-02 15:28:38
【问题描述】:

可能重复:
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;
 }

【问题讨论】:

标签: php internet-explorer select innerhtml xajax


【解决方案1】:

在 DOM 模型中处理 &lt;select&gt; 元素的更可移植方式在 http://support.microsoft.com/kb/276228 中进行了描述

【讨论】:

    猜你喜欢
    • 2018-02-01
    • 2010-10-12
    • 2010-09-13
    • 2016-08-17
    • 2010-12-14
    • 2020-10-02
    • 1970-01-01
    • 1970-01-01
    • 2011-01-28
    相关资源
    最近更新 更多