473,385 Members | 1,707 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,385 software developers and data experts.

Multiple loops

Hi all,

I'm my script I've three loops processing a very huge data file. IE &
Firefox show a message box after some time saying my script could be
infinite looping and give me a chance to stop it.

Is there a way to prevent this dialog box to show up? I'm writing a
script used only on a intranet and the final customer should not see the
message box.

Thanks in advance,
Feb 6 '06 #1
6 2872
Fabian Vilers wrote on 06 feb 2006 in comp.lang.javascript:
I'm my script I've three loops processing a very huge data file. IE &
Firefox show a message box after some time saying my script could be
infinite looping and give me a chance to stop it.

Is there a way to prevent this dialog box to show up? I'm writing a
script used only on a intranet and the final customer should not see the
message box.


Consider not using clientside scripting.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Feb 6 '06 #2
Evertjan. wrote:
Consider not using clientside scripting.


Unfortunately, this is not an option.
Feb 6 '06 #3
Fabian Vilers wrote on 06 feb 2006 in comp.lang.javascript:
Evertjan. wrote:
Consider not using clientside scripting.


Unfortunately, this is not an option.


A programmer without technically necessary options
should decline the assignment!

In-browser javascript is not fitted for huge tasks.
[due to time and memory constraints]

Try:

A good database, w/cscript, compiled tasks like VB, c++, etc.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Feb 6 '06 #4
Evertjan. wrote:
A programmer without technically necessary options
should decline the assignment!

In-browser javascript is not fitted for huge tasks.
[due to time and memory constraints]

Try:

A good database, w/cscript, compiled tasks like VB, c++, etc.


Thanks for your analysis Evertjan ;-) Like I said, I've no option. My
best choice for now on is to make big replace in a string :( (see other
post).

Thanks anyway
Feb 6 '06 #5
Fabian Vilers wrote:
I'm my script I've three loops processing a very huge data file. IE &
Firefox show a message box after some time saying my script could be
infinite looping and give me a chance to stop it.

Is there a way to prevent this dialog box to show up? I'm writing a
script used only on a intranet and the final customer should not see
the message box.


Since as you say not only using client-side scripting is not an option, I
think with unchanged code (see below) you will have to restrict your target
browser to Firefox and have your clients set this preference in their
user.js configuration file (or via `about:config'):

user_pref("dom.max_script_run_time", "0");

Setting this preference to 0 is specified to disable the warning. I have
set it to 60 (seconds) here.

I do not know if there is such a preference for IE, hence the Firefox
restriction.

However, you should definitely analyze the efficiency of your code,
especially of your loops, before you try anything else. For example,
using

/* a is an Array or collection object */
// order does not matter
for (var i = a.length; i--;)

or

// order does matter
for (var i = 0, len = a.length; i < len; i++)

is known to be faster than

for (var i = 0; i < a.length; i++)

Storing references of lookups from to the second level upwards in a (local)
variable and reusing that variable instead of looking up over and over
again (as was done in the first two examples) is another working means to
increase runtime efficiency, thus decreasing runtime.
HTH

PointedEars
Feb 6 '06 #6
Thomas 'PointedEars' Lahn wrote:
Fabian Vilers wrote:
["script too slow" warning in IE and Firefox]


Since as you say not only using client-side scripting is not an option, I
think with unchanged code (see below) you will have to restrict your
target browser to Firefox and have your clients set this preference in
their user.js configuration file (or via `about:config'):

user_pref("dom.max_script_run_time", "0");


Should be

user_pref("dom.max_script_run_time", 0);

of course.
PointedEars
Feb 6 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Jacek Generowicz | last post by:
I have a multiple disptacher which, conceptually, looks something like this: class Multimethod: def __init__(self): self.methods = {}
1
by: Knocked Wood | last post by:
Hi, I looked around and can't find anything on this at all and can not get it to work for IE. I'm trying to loop multiple sounds on a game, with three unique variables, when a link is clicked....
20
by: km | last post by:
Hi all, In the following code why am i not able to access class A's object attribute - 'a' ? I wishto extent class D with all the attributes of its base classes. how do i do that ? thanks in...
5
by: john | last post by:
Hello, I am trying to send 2^19 data to USB2.0. I am reading the file "all_sines" and loading it into an array called "string1". Then, in a for loop I copied it into the USB data array...
32
by: tshad | last post by:
Can you do a search for more that one string in another string? Something like: someString.IndexOf("something1","something2","something3",0) or would you have to do something like: if...
4
by: Matt Ratliff | last post by:
Hello, I would appreciate any assistance you have with the following problem: I have (as an example) an array of values as follows: arrayvalues=new Array("0001","0003","0005") where each is the...
37
by: bahoo | last post by:
Hi, I have a list like and as output I want If I myList.remove('0024') then only the first instance of '0024' is removed.
11
by: O.B. | last post by:
Does C# support anything like PHP's break command that optionally accepts a parameter specifying how many loops to break out of?
13
by: Joel Koltner | last post by:
Is there an easy way to get a list comprehension to produce a flat list of, say, for each input argument? E.g., I'd like to do something like: for x in range(4) ] ....and receive
5
by: TP | last post by:
Hi everybody, Several means to escape a nested loop are given here: http://stackoverflow.com/questions/189645/how-to-break-out-of-multiple-loops-in-python According to this page, the best...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.