473,659 Members | 2,662 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2887
Fabian Vilers wrote on 06 feb 2006 in comp.lang.javas cript:
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.javas cript:
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
1773
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
4667
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. Something like... <Script Language="JavaScript"> <!-- function playSound(soundName, loops, timeLength){
20
10072
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 advance for enlightment ... here's the snippet #!/usr/bin/python
5
440
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 "Data_outBuffer". The USB can carry only "32767" bytes at one time. The way I am doing right now requires 16 for loops to send the 2^19 amount of data. ( 32767 * 16 = 2^19). How can i solve this problem by using two loops. Is it possible? Please advice!
32
14837
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 ((someString.IndexOf("something1",0) >= 0) || ((someString.IndexOf("something2",0) >= 0) ||
4
2460
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 value of an option in a select statement: <select id="usertypes" multiple="multiple"> <option value="0033">data1</option>
37
19172
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
9698
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
1510
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
1738
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 way is to modify the loop by affecting the variables that are tested in the loops. Otherwise, use exception: "If, for some reason, the terminating conditions can't be worked out,
0
8330
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8523
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8626
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6178
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2749
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1975
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.