XSL无法在Chrome中呈现/正常运行 [英] XSL not rendering/acting properly in Chrome

查看:130
本文介绍了XSL无法在Chrome中呈现/正常运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我正在努力将10到12年的旧代码更新为与Chrome兼容,而我已经停滞了.无论出于何种原因,当我输入数字然后单击"fillPO"按钮时,它都不会更新任何内容,而是将"null"放入应该填充的框中.这可以在Internet Explorer上按预期工作.是否有通用规则可以使它在chrome上运行?

So, I'm working on updating 10-12 year old code to be Chrome compatable, and I've stalled out already. For whatever reason, when I input a number and then click the "fillPO" button, it doesn't update anything, and instead places a "null" into the box it should be filling. This works as intended on Internet Explorer. Is there a general rule to get this to work on chrome?

<xsl:template name="control-row">
    <xsl:if test="$orderApprove='true' and $isSuperUser='false' and $archiveView='false' ">
        <td nowrap="true" colspan="10">
            <input type="button" name="servlet" value="Approve" onClick="return approveOrder();">&nbsp;checked orders</input>
            <xsl:if test="/poursxml/OrderedFields/Field='PO'">
                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                Fill PO number across orders:&nbsp;
                <input type="text" name="genericPO" id = "genericPO" size="15" maxlength="30"/>
                &nbsp;
                <input type="button" value=" Fill PO " onclick="fillPO()"/>
            </xsl:if>
        </td>
    </xsl:if>
</xsl:template>

这是javascript中的fillPO().

This is the fillPO() in javascript.

function fillPO()
{
    if(!anySelected())
        alert('Please select an order first.');
    else
    {
        dfa = document.getElementsByName('orderNumber');
        len = dfa.length;
        var ix = 0;
        for(ix=0; ix<len; ix++)
        {
            if(dfa[ix].name == 'orderNumber')
            {
                if(dfa[ix].checked == true)
                {
                    el_id = dfa[ix].id;
                    position = el_id.substring(11);
                    document.getElementById('PONumber' + position).innerHTML = '<input size="15" maxlength="30" type="text" name="PONumber" value="' + document.getElementById('genericPO').getAttribute('value') + '"></input>';
                }
            }
        }    
    }
} 

推荐答案

疯狂猜测:用document.getElementById('genericPO').value替换document.getElementById('genericPO').getAttribute('value').

但是我们确实需要查看一个示例,使我们能够在Chrome中重现该问题.

But we really need to see a sample allowing us to reproduce the problem in Chrome.

这篇关于XSL无法在Chrome中呈现/正常运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆