TrainBeaser for iPhone
The moose likes HTML, CSS and JavaScript and the fly likes alert in Mozilla 1.4 Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "alert in Mozilla 1.4" Watch "alert in Mozilla 1.4" New topic
Author

alert in Mozilla 1.4

Jeramie Maratas
Greenhorn

Joined: Mar 16, 2004
Posts: 13
I have a simple application that alerts a message when the input of the user is wrong. The alert seems to work fine with IE and Opera but when i tested it in Mozilla 1.4 under Turbo Linux Desktop OS, the alert always comes out.
Does anyone have any idea why is this so? Thanks..

Best Regards,
Jen


Best Regards,
Jen
Jeramie Maratas
Greenhorn

Joined: Mar 16, 2004
Posts: 13
Hi,
I already found out the reason but unfortunately I dont know the solution yet. Here is a snippet of the code:
for(var i=1; i<= arrFiles.length; i++ ) {
if ( e.value == arrFiles[i]) {
bIsDuplicate = "true";
alert("The selected file is already in the file list.");
break;
}
}

It seems like the "break" command does not seem to work in Mozilla. I tried the "return" command too but it did not work as well.
Any help is very much appreciated.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15003
try setting i to i = arrFiles.length + 10; instead of break,
And is there any reason you are starting at 2nd position (i=1) instead of the first position (i=0)?
Eric
Yuriy Fuksenko
Ranch Hand

Joined: Feb 02, 2001
Posts: 411
Actually,
e.value == arrFiles[i] with i equals arrFiles.length does not make sense, since arrFiles[arrFiles.length] is always undefined.
break should work fine everywhere. Try the following:
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15003
You are right with the length the <= should just be <
 
IntelliJ Java IDE
 
subject: alert in Mozilla 1.4
 
Threads others viewed
Multiple Pop-Up Problem
jdk1.3.1 compiled applets cause NS 6 to crash - why?
Problem in Submit() Function
Resetting jsp form elements in mozilla
Ajax: responseXML, getElementsByTagName
IntelliJ Java IDE