[英]Invalid Argument error in javascript
My Javascript code goes something like this 我的Javascript代码是这样的
Var Mainurl=”http://localhost/Employee/SearchEmployee.aspx?”
var url = { "eid" :empID,
"DOB" : dob,
"Gender" : gender,
"Category" : category,
"IsActive" :isActive
};
window.open(Mainurl + Ext.urlEncode(url), 'Search Employee', "status=0, toolbar=0, location=0, menubar=0, directories=0, resizable=1, scrollbars=0,height=700, width=1000" );
When I execute my application in IE (v6.0) it gives error “invalid arguments” at window.open but works fine in Firefox. 当我在IE(v6.0)中执行我的应用程序时,它在window.open上给出错误“无效参数”,但在Firefox中可以正常工作。 Anyone has any idea how can I solve this?
有人知道我该如何解决吗?
Change your first line from: 将第一行从以下位置更改:
Var Mainurl=”http://localhost/Employee/SearchEmployee.aspx?”
To 至
var Mainurl="http://localhost/Employee/SearchEmployee.aspx?";
Var
should be var
and your speach marks should be "
instead of ”
. Var
应该是var
并且您的口语标记应该是"
而不是”
。
Please correct the syntaxes first. 请首先更正语法。 Like
Var
should be var
Try the following url. 像
Var
应该是var
尝试以下网址。
var url = { eid :empID,
DOB : dob,
Gender : gender,
Category : category,
IsActive :isActive
};
Ext.urlEncode()
takes an object and converts it to an encoded URL. Ext.urlEncode()
接受一个对象并将其转换为编码的URL。 eg Ext.urlEncode({foo: 1, bar: 2});
例如
Ext.urlEncode({foo: 1, bar: 2});
would return "foo=1&bar=2"
. 将返回
"foo=1&bar=2"
。 .. ..
very surprised that such thing works in FF. 这种事情在FF中很有效,我感到非常惊讶。 you should use
你应该使用
var mainurl...
and NOT 并不是
Var Mainurl...
var is always var (lowercase). var始终为var(小写)。 and variables like mainurl are lowercase too (but this is "just" convention).
并且像mainurl这样的变量也是小写的(但这是“正好”的约定)。
so first change the Var to a var. 因此,首先将Var更改为var。 and check if Ext.urlEncode is loaded and compatible with ie6 (don't know, but think its an js lib, right?).
并检查Ext.urlEncode是否已加载并与ie6兼容(不知道,但认为它是js库,对吗?)。
and then get yourself a update on IE ;) (shouldnt support IE 6 anymore, way to much headache) 然后让自己获得IE的更新;)(不应该再支持IE 6,非常令人头疼)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.