473,405 Members | 2,154 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Function Calls work on IE but not on Netscape

Hi all! I am new to this group but not so new to web programming. However I am having a problem that I have not encountered before. I have a function that when called from another function fires up in IE but just hangs in Netscape. Here is the call to the function...
Expand|Select|Wrap|Line Numbers
  1. var colArr = new Array();
  2. colArr = RemoveEmbeddedCommas(caseLogArr[i]);
  3.  
caseLogArr is an array of strings.

I have a string that has fields delimited by commas, however, I also have fields that have quotes surrounding the text and that text contains embedded commas. A typical string segment would look like this...

Monday,"January 1, 2007",Tuesday,"January 2, 2007" etc.

My function eliminates the embedded commas so that I do not have separate fields for like ["January 1] and [2007"].

Here is the function...
Expand|Select|Wrap|Line Numbers
  1. function RemoveEmbeddedCommas(colStr)
  2. {
  3.     var colArr = new Array();
  4.     var newArr = new Array();
  5.     var colArrIndex;
  6.     var quoteIndex = 0;
  7.     var newArrIndex = 0;
  8.     var matchQuoteFound;
  9.  
  10.     colArr = colStr.split(",");
  11.  
  12.     for (colArrIndex = 0; colArrIndex < colArr.length; colArrIndex++)
  13.     {
  14.         if (colArr[colArrIndex].indexOf('"') == 0 && colArr[colArrIndex].indexOf('"',1) == -1)
  15.         {
  16.             quoteIndex = colArrIndex + 1;    
  17.             newArr[newArrIndex] = colArr[colArrIndex];
  18.             matchQuoteFound = false;
  19.             while (matchQuoteFound == false) 
  20.             {
  21.                 newArr[newArrIndex] = newArr[newArrIndex] + " " + colArr[quoteIndex];
  22.                 if (colArr[quoteIndex].indexOf('"',1) > 0)
  23.                 {
  24.                     matchQuoteFound = true;
  25.                 }    
  26.                 quoteIndex++;
  27.                 colArrIndex++;
  28.             }
  29.         }
  30.         else
  31.         {
  32.             newArr[newArrIndex] = colArr[colArrIndex];
  33.         }
  34.         newArrIndex++;
  35.     }
  36.     return(newArr);
  37. }
Like I said, this seems to work fine when I run it in IE but Netscape just hangs in the loading mode forever.

Thanks for any help,
Joe Ruvolo
Jul 20 '07 #1
2 1117
kovik
1,044 Expert 1GB
It's likely that your while loop isn't ever terminating and, looking at it, it's not very well designed.

You could do what you're after using RegExp.
Jul 21 '07 #2
Thank you voltricity!

I agree that the while is messy, so I reconstructed how I get the data in the first place and no longer need the while loop as it was. It all seems to work now.

Thanks again for your reply.

Joe Ruvolo
Jul 23 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Penn Markham | last post by:
Hello all, I am writing a script where I need to use the system() function to call htpasswd. I can do this just fine on the command line...works great (see attached file, test.php). When my...
9
by: Martin Waller | last post by:
Hello, I've been playing with the idea of just how to use an ASP page to provide a remote function call. In an ideal world this would be a web service but how can you do it if restricted to ASP...
3
by: KathyB | last post by:
Hi, I've tried everything I can think of. Using the script below, I thought on submit my ConfirmSave function would run, then if true returned, would run my form action. At this point it appears...
15
by: chirs | last post by:
I am trying to understand a piece of code. In a javascrpit file, there is a function: function ItemStyle(){ var names=; addProps(this,arguments,names,true); }; In the html file, it calls...
2
by: Geniium | last post by:
Hello, Im looking to make work my script on both IE and Netscape. It works fine in IE, but netscape cant handle "dynamic" variables. I need some help! Is there a CORRECT way to pass a string...
3
by: btopenworld | last post by:
I have a Flash movie with parameter 'autoplay' set to false. The movie is started using a Macromedia javascript function via onload. This is OK in IE but Netscape 6 doesn't run the movie - it...
10
by: VictorG | last post by:
Hello, I am new to JS and am trying to add some HTML into a JS function. So that when called the script as well as the HTML will be invoked. Is there some type of embed mechanism, sort of the...
4
by: Hermann Maier | last post by:
hi, i need to find out the memory usage of a specific function that i use in my program. this function does some recursive calculations and i want my program to display the amount of memory the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.