在Firefox中出现404错误Chrome在IE上运行顺畅可能是什么原因

Getting 404 error in Firefox & Chrome where as same thing running smoothly on IE what could be the reason

本文关键字:是什么 运行 IE Firefox Chrome 错误      更新时间:2023-09-26

我需要使我的网站浏览器独立,它是专门为IE设计的。现在有几个按钮点击它们,我得到404,因为同样的事情在IE上运行顺利。我已经使用Ajax JSON jQuery在我的网站

HTML代码

<input type="hidden" selectedId="    <%=JspWriterHelper.escapeHtml(crt.getTempidPK())%>"  name="item<%=JspWriterHelper.escapeHtml(numItems)%>" value="false">
JAVASCRIPT代码

function createSelected()
{
var noOfSel = 0 ;
var returnValue ='' ;
var sand = 1;
var theForm = document.someForm;
for (var i = 0; i < theForm.length; i++)
{
    var e = theForm.elements[i];
    var s= theForm.elements[i].selectedId;
    if ((e.type == "hidden") && (e.value == "true") && (e.name.indexOf("item")==0) )
    {
        if(sand == 1)
        {
            sand = 0;
        }
        else
        {
            returnValue += '&';
        }
        console.log("the value of selected IDS="+e.selectedId);
        if (e.selectedId != undefined )
        {   
            returnValue += 'runTemplateId'+ noOfSelections +'='+ e.selectedId;
            noOfSelections ++ ;
        }
    }
}
return (returnValue+'&numberOfTemplates='+noOfSelections);

}

这在IE中可以正常工作,e.selectedId反映了正确的id,但在Firefox中这是UNDEFINED

你能告诉我为什么firefox和crome没有定义相同的东西吗?

我们可以使用form .elements[i].getAttribute("selectedId"),因为这将适用于firefox,chrome和IE

where as theForm.elements[i].selectedId;将不能在firefox和chrome中工作,它将给出UNDEFINED作为值。但是同样的事情在IE中也可以正常工作。