Invalid Argument error in javascript
My Javascript code goes something like this
Var Mainurl=”http://localhost/Employee/SearchEmployee.aspx?”
var url = { "eid" :empID,
开发者_如何学JAVA"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. 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 ”
.
Please correct the syntaxes first.
Like Var
should be var
Try the following url.
var url = { eid :empID,
DOB : dob,
Gender : gender,
Category : category,
IsActive :isActive
};
Ext.urlEncode()
takes an object and converts it to an encoded URL. e.g. Ext.urlEncode({foo: 1, bar: 2});
would return "foo=1&bar=2"
. ..
very surprised that such thing works in FF. you should use
var mainurl...
and NOT
Var Mainurl...
var is always var (lowercase). and variables like mainurl are lowercase too (but this is "just" convention).
so first change the Var to a var. and check if Ext.urlEncode is loaded and compatible with ie6 (don't know, but think its an js lib, right?).
and then get yourself a update on IE ;) (shouldnt support IE 6 anymore, way to much headache)
精彩评论