Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/469.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 出现TypeError异常:window.parent.leftframe.document.viewForm不是函数_Javascript_Function_Google Chrome_Typeerror - Fatal编程技术网

Javascript 出现TypeError异常:window.parent.leftframe.document.viewForm不是函数

Javascript 出现TypeError异常:window.parent.leftframe.document.viewForm不是函数,javascript,function,google-chrome,typeerror,Javascript,Function,Google Chrome,Typeerror,这个JS在IE上工作,但当我使用Chrome时,总是会出现以下错误: 例外情况 : TypeError:window.parent.leftframe.document.viewForm不是处于选中状态的函数 我使用此代码检查表单输入,如果用户在表单中输入命令,则返回true) 你能解释一下吗 谢谢! 文斯 我看到[31]。当鼠标移动到名称时,名称与其他名称相同。 我怎样才能从中获得nodeValue 谢谢 说IE没有给你一个错误(你应该得到)可能更正确 在第一个if语句中,window…vie

这个JS在IE上工作,但当我使用Chrome时,总是会出现以下错误:

例外情况 : TypeError:window.parent.leftframe.document.viewForm不是处于选中状态的函数

我使用此代码检查表单输入,如果用户在表单中输入命令,则返回true)

你能解释一下吗

谢谢! 文斯

我看到[31]。当鼠标移动到名称时,名称与其他名称相同。 我怎样才能从中获得nodeValue


谢谢

说IE没有给你一个错误(你应该得到)可能更正确

在第一个
if
语句中,
window…viewForm…
被视为具有名为“changed”的属性的对象,该属性具有名为“value”的属性;但是,稍后您将引用与函数相同的内容。查看Chrome中的
文档
属性/对象,我没有看到
视图表单
属性(因此,Chrome中的错误)


此外,如果您在将来发布正在使用的HTML位,这将非常有用。

说IE没有给您错误(您应该得到错误)可能更正确

在第一个
if
语句中,
window…viewForm…
被视为具有名为“changed”的属性的对象,该属性具有名为“value”的属性;但是,稍后您将引用与函数相同的内容。查看Chrome中的
文档
属性/对象,我没有看到
视图表单
属性(因此,Chrome中的错误)


此外,如果将来发布正在使用的HTML位,这将非常有用。

我还添加了ViewForm代码。这已经在IE上运行了很长时间,但我们在Chrome上解决了这个问题,不确定这是否与AcionForm有关。1)看起来ViewForm代码是java,而不是javascript。2) 什么是
window.parent.leftframe.document.viewForm
定义的?在调查了其他人编写的这个项目后,我发现viewForm位于使用struts1的JSP中。我还更新了viewForm代码。使用
.name
,而不是
.value
(在javascript中)。我认为
.getParameter(“命令”)
可以在JSP中工作,但这已经超出了我的范围。谢谢大家,.getParameter不工作。我使用了.value,效果很好。我还添加了ViewForm代码。这已经在IE上运行了很长时间,但我们在Chrome上解决了这个问题,不确定这是否与AcionForm有关。1)看起来ViewForm代码是java,而不是javascript。2) 什么是
window.parent.leftframe.document.viewForm
定义的?在调查了其他人编写的这个项目后,我发现viewForm位于使用struts1的JSP中。我还更新了viewForm代码。使用
.name
,而不是
.value
(在javascript中)。我认为
.getParameter(“命令”)
可以在JSP中工作,但这已经超出了我的范围。谢谢大家,.getParameter不工作。我用了。价值,它起作用了。
function Checked() 
    {
    if (window.parent.leftframe.document.viewForm.changed.value == "true") {
        return true;
    }
    else {
        for (k = 0; k < 30; k++) {
            memcom = "member[" + i + "].command";    
            if (window.parent.leftframe.document.viewForm(memcom) != null && window.parent.leftframe.document.viewForm(memcom).value != "") {
        return true;
        }
    }
    return false;
    }
}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>

<table class="Product" cellspacing="1">
    <html:form action="/viewSubmit" method="post" onsubmit="return onSubmitForm()">
        <input type="hidden" name="submited" value="false"> 
        <html:hidden property="action"></html:hidden>
        <html:hidden property="changed"></html:hidden>
......

                <logic:equal name="viewForm" property="opt.withMemberList" value="true">
.......

                        <td colspan="3" class="Product2">
                <a href="#" onclick="return <bean:write name="viewForm" property="listpURL" listp="false"/>"><IMG src="images/product_list_button.gif" border="0" /></a>                
            </td>
..........              <tr>
                        <logic:iterate id="member" name="viewForm" property="members" indexId="i">
                ....                
                <html:hidden indexed="true" name="member" property="remark"></html:hidden>                                  
                <td align="location" class="Product2">
                    <html:select name="member" indexed="true" property="command" disabled="false">
                    <html:options name="member"  property="commandSelection"/>                                              
                    </html:select>          
                </td>
                         </tr>
......
        </logic:equal>
    </html:form>
</table>        

</html>
name:"member[0].command"
nextElementSibling:null
nextSibling:text
nodeName:"SELECT"
nodeType:1
nodeValue:null
nonce:""