1

I am trying to run a script, which is intense(that is lot of loops etc.). When I am trying to call this method in loop, I am getting an error:

"The JavaScript operation is blocking the normal operation of IE. Do you want to stop running the script?" Yes No.

Is there something I am missing? I have seen worse scripts running just fine.

Sid
  • 4,893
  • 14
  • 55
  • 110
  • 1
    Can you provide us with a sample of the script? There maybe optimisations that could be performed :) – Alastair Pitts Sep 15 '10 at 05:19
  • That depends on a lot of stuff, e.g. how many elements you loop over, what kind of loops, nested loops, etc. How does it behave in Firefox, Chrome, ...? Have you profiled your code? Everything that takes longer than 100ms is bad anyway. Without example code, what answer do you expect? – Felix Kling Sep 15 '10 at 05:23
  • The functionality is something like this: There are two uni-select drop downs side by side on the screen. The user can select one value from each drop down and click ADD button which will add the two values in a table below. There is a button which says ADD ALL, clicking which the javascript code adds all values to table. When a values is added to table, it is removed from drop down. Similar feature is given in table. When a value is removed from table it is added back to the corresponding drop downs. Also, the values have to be added in ascending order of sorting in both operations. – Sid Sep 15 '10 at 16:46

1 Answers1

1

If your script does that, you might want to re-engineer your code.

If your code really need to loop for that long you will be dealing with some timeouts in your script to stop every time you think is necessary to avoid this "behavior"...

I recommend to check this post JavaScript and Threads

Community
  • 1
  • 1
Garis M Suero
  • 7,974
  • 7
  • 45
  • 68