Total members 11890 |It is currently Fri Apr 19, 2024 10:51 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





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.
put code tag


Author:
Newbie
User avatar Posts: 10
Have thanks: 0 time

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:

_________________
Please recommend my post if you found it helpful


Author:
Beginner
User avatar Posts: 95
Have thanks: 2 time

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>



Author:
Newbie
User avatar Posts: 10
Have thanks: 0 time

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:

_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time

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


Author:
Newbie
User avatar Posts: 10
Have thanks: 0 time

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

Thanks,
Kaviurs


Author:
Newbie
User avatar Posts: 10
Have thanks: 0 time
Post new topic Reply to topic  [ 6 posts ] 

  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     -  



cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com