Switch to full style
HTML,DHTML,Javascript,XML,CSS
Post a reply

Invalid Argument error in IE7

Mon Jun 23, 2008 8:06 am

I have a very simple Javascript function for opening a popup window, however it fails in IE7 with an "Invalid Argument" error. It works fine in IE6, Opera and Firefox 2.0.

The code is as follows:
Code:
function Validate() {
   window.open("LoginWait.stm %LI"+SmtSysToBase64("?Username="+document.Form.Username.value+"&Password="+document.Form.Password.value+"&RNum="+(new Date()).getTime()), "_top");

}


The error line and character of the error is always character 2 of the line "window.open" appears on in the code.

Any one help to solve this Issue in IE7.

Thanks,
Kaviurs


Last edited by DrRakha on Mon Jun 23, 2008 4:32 pm, edited 1 time in total.
Reason: put code tag

Re: Invalid Argument error in IE7

Mon Jun 23, 2008 4:31 pm

I think your problem is on how to call this function from html code ,
you should call it like these forms

Code:
<a href="#" onclick="Validate()">Click</a>


or

Code:
<a href="<a href="java script:Validate()">Click</a>


or i think there is a space in the argument of your window.open url ,
:confused:

Re: Invalid Argument error in IE7

Tue Jun 24, 2008 6:03 am

Already tried to remove the space in argument...the same error...

Plz check this is my entire code.
html code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Login</TITLE>
<META http-equiv="Pragma" content="no-cache">
<LINK type="text/css" rel="stylesheet" href="VKStyle.css">
<SCRIPT type="text/javascript" language="JavaScript" src="<!--#HTMLStatic-->Base64.js">
</SCRIPT>
<SCRIPT type="text/javascript" language="JavaScript">
<!--
function HandleError(message, url, line) {
return true;
}
self.onerror = HandleError;

GoodVersion = 0;
WinNSMin = 4.70;
MacNSMin = 4.61;
WinIEMin = 5.0;
MacIEMin = 5.0;

NS = (document.layers);
IE = (document.all);
if (!NS && !IE && (navigator.appName.indexOf("Netscape") != -1)) {
NS = 1;
}
if (!NS && !IE && (navigator.appName.indexOf("Microsoft") != -1)) {
IE = 1;
}
isMac = (navigator.appVersion.indexOf("Mac") != -1);

if (NS) {
NSVer = parseFloat(navigator.appVersion);
GoodVersion = (!isNaN(NSVer) && ((!isMac && (NSVer >= WinNSMin)) || (isMac && (NSVer >= MacNSMin))));
} else if (IE) {
IEVerIdx = navigator.appVersion.indexOf("MSIE");
if (IEVerIdx != -1) {
IEVer = parseFloat(navigator.appVersion.substring(IEVerIdx+4, IEVerIdx+11));
GoodVersion = (!isNaN(IEVer) && ((!isMac && (IEVer >= WinIEMin)) || (isMac && (IEVer >= MacIEMin))));
}
}

function Initialize() {

if (self.parent.frames.length != 0) self.parent.location=document.location.href;

document.Form.Username.focus();
document.cookie = "VKSessionID=0;Path=/";

if (!GoodVersion) {
if (isMac) {
window.alert("This site requires Netscape "+MacNSMin+", or IE "+MacIEMin+"!");
}
else {
window.alert("This site requires Netscape "+WinNSMin+", or IE "+WinIEMin+"!");
}
}
}

function Validate() {
window.open("LoginWait.stm %LI"+SmtSysToBase64("?Username="+document.Form.Username.value+"&Password="+

document.Form.Password.value+"&RNum="+(new Date()).getTime()), "_top");

}
//-->
</SCRIPT>
</HEAD>
<BODY background="<!--#HTMLStatic-->Images/Sys_tile.gif" onload="Initialize()">
<BR>
<BR>
<BR>
<FORM action="javascript:Validate()" name="Form">
<TABLE align="CENTER" border="4" bordercolor="#999999" bordercolordark="#666666"

bordercolorlight="#CCCCCC" cellpadding="0" cellspacing="0">
<TR>
<TD>
<TABLE class="FormBkgnd" width="100%" border="0" cellpadding="3" cellspacing="0">
<TR class="WindowTitleBar">
<TH class="WindowTitle" colspan="2" align="left">Login</TH>
</TR>

<TR>
<TH class="DialogHeader" colspan="2"><!--#FacilityName--></TH>
</TR>

<TR>
<TH class="DialogHeader" colspan="2">Welcome</TH>
</TR>

<TR>
<TH class="DialogHeader" align="right">User Name:</TH>
<TD align="left"><INPUT type="text" value="" size="20" maxlength="22" name="Username" tabindex="1"></TD>
</TR>

<TR>
<TH class="DialogHeader" align="right">Password:</TH>
<TD align="left"><INPUT type="password" value="" size="20" maxlength="20"

name="Password" tabindex="2"></TD>
</TR>

<TR>
<TH colspan="2" align="center"><INPUT type="SUBMIT"

name="FAKESubmit" value="Login" tabindex="3"></TH>
</TR>

</TABLE>
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>


Re: Invalid Argument error in IE7

Tue Jun 24, 2008 4:34 pm

i tried to run this code on IE7, there is an error , in the line of
window.open as you said inside the function of validate. To me i think that the error is in this part ( LoginWait.stm %LI) ..., i want to knew something , i know you are passing paramters by url to another page ,but what is this means ".stm" extention ! , what is the type of programing language you are using here.And why you left an white space between LoginWait.stm and %LI !! :confused:

Re: Invalid Argument error in IE7

Thu Jun 26, 2008 8:19 am

The .STM file is called a streaming file, the data is added to it sequentially in its native format. The data itself inside the STM file is not encoded or encrypted, the file can be viewed using a text editor.

In above code, we used "LoginWait.stm %LI".I tried without space like("LoginWait.stm%LI"), whenever I entered the usrname& Passwrd, both values are passed on addressbar, but next window "Loginwait.stm" is not open.

I tried with space like("LoginWait.stm %LI"), at that time its says "Invalid argument Error".

In IE6 its runs properly. But IE7 is a problem.

Thanks,
Kaviurs

Re: Invalid Argument error in IE7

Thu Jul 03, 2008 6:43 am

I tried this method encodeURIComponent() in window.open() like
window.open(encodeURIComponent("Login.stm %LI")...................... ) , I got a result.

Thanks,
Kaviurs

Post a reply
  Related Posts  to : Invalid Argument error in IE7
 invalid argument on IE with script to center objects     -  
 Invalid unicode sequence error ("u")     -  
 Invalid integer formats     -  
 Passing an Argument to a Function by Value     -  
 Function with an Optional Argument     -  
 invalid drive or directory     -  
 argument type of a program's main() method     -  
 ERROR     -  
 Deliberate Error     -  
 error in code     -