Loading ...
Sorry, an error occurred while loading the content.

Error: A script on this page is causing Internet Explorer to run slowly

Expand Messages
  • mkoziel2000
    I found that if I create a modal Panel object using YUI, I can get into the situation where IE (and firefox for that matter) will eventually display an alert
    Message 1 of 5 , Nov 1, 2007
    • 0 Attachment
      I found that if I create a modal Panel object using YUI, I can get
      into the situation where IE (and firefox for that matter) will
      eventually display an alert box asking the user whether they want to
      abort the currently running script.

      I found on Microsoft's website that they will pop up this alert box
      whenever 5 million lines of code are executed for a given page in
      order to help prevent against infinite loop scenarios.

      In the case of YUI modal panel controls, it looks like we are
      achieving modality by forcing the focus away from controls that are
      not part of the panel area using the Yahoo.events framework. This
      apprently chews away at the 5 million lines rather quickly whenever
      there are tons of "focusable" controls being silenced while the modal
      panel object is presented.

      In my scenario, I have a web page showing 1500 links and 1500 edit
      boxes among other text. This is enough to cause IE to respond with
      the alert box whenever I try to create and display a modal panel
      object that may only contain 5 "focusable" controls.

      Turning off the "modal" setting when creating the panel alleviates
      the issues.

      Have others experienced this? What has been your workaround allowing
      you to continue using a modal environment (aside from having the
      answer be: "display a web page with fewer controls").
    • Satyen Desai
      Hi, Thanks for the detailed report. I ll try to reproduce your test case, but if you have a test page already you can point us to, that would help. I d like to
      Message 2 of 5 , Nov 1, 2007
      • 0 Attachment
        Hi,
        Thanks for the detailed report.

        I'll try to reproduce your test case, but if you have a test page
        already you can point us to, that would help. I'd like to see how the
        time spent enforcing modality is broken up - the finding of elements,
        the attaching of focus listeners etc. That said, I can see how the
        current modal enforcement strategy would not scale well with a large
        number of elements to "disable" (as a result of the above 2 steps).

        If you can file a bug for the issue, even better.

        I'll look into a workaround for you, but off the top of my head, it'll
        probably require unsubscribing Panel's default "showMask" event
        listener, and subscribing a patched version (or nothing at all, and
        simply hiding the non panel focusable elements using CSS to maintain
        modality).

        Regards,
        Satyen
      • brendangibson
        I am having a similar problem, though I only get it with IE. In my case it takes about 20 times of opening and closing the panel to get the IE alert. I don t
        Message 3 of 5 , Feb 26, 2008
        • 0 Attachment
          I am having a similar problem, though I only get it with IE.

          In my case it takes about 20 times of opening and closing the panel to
          get the IE alert. I don't have quite as many elements on the page,
          though I do have quite a few.

          Was anyone able to provide a workaround for this issue? Were Satyen's
          thoughts good enough to follow through with?

          --- In ydn-javascript@yahoogroups.com, "Satyen Desai" <sdesai@...> wrote:
          >
          > Hi,
          > Thanks for the detailed report.
          >
          > I'll try to reproduce your test case, but if you have a test page
          > already you can point us to, that would help. I'd like to see how the
          > time spent enforcing modality is broken up - the finding of elements,
          > the attaching of focus listeners etc. That said, I can see how the
          > current modal enforcement strategy would not scale well with a large
          > number of elements to "disable" (as a result of the above 2 steps).
          >
          > If you can file a bug for the issue, even better.
          >
          > I'll look into a workaround for you, but off the top of my head, it'll
          > probably require unsubscribing Panel's default "showMask" event
          > listener, and subscribing a patched version (or nothing at all, and
          > simply hiding the non panel focusable elements using CSS to maintain
          > modality).
          >
          > Regards,
          > Satyen
          >
        • Satyen Desai
          See: http://sourceforge.net/tracker/index.php?func=detail&aid=1884118&group_id=165715&atid=836476 However, your case maybe something different, since
          Message 4 of 5 , Feb 26, 2008
          • 0 Attachment
            See:

            http://sourceforge.net/tracker/index.php?func=detail&aid=1884118&group_id=165715&atid=836476

            However, your case maybe something different, since opening/closing the panel shouldn't result in the problem below unless elements
            are getting added to the document each time you open/close.

            Are you maybe creating a new instances every time you open?

            Regards,
            Satyen
            ________________________________________
            From: ydn-javascript@yahoogroups.com [mailto:ydn-javascript@yahoogroups.com] On Behalf Of brendangibson
            Sent: Tuesday, February 26, 2008 7:36 AM
            To: ydn-javascript@yahoogroups.com
            Subject: [ydn-javascript] Re: Error: A script on this page is causing Internet Explorer to run slowly

            I am having a similar problem, though I only get it with IE.

            In my case it takes about 20 times of opening and closing the panel to
            get the IE alert. I don't have quite as many elements on the page,
            though I do have quite a few.

            Was anyone able to provide a workaround for this issue? Were Satyen's
            thoughts good enough to follow through with?

            --- In ydn-javascript@yahoogroups.com, "Satyen Desai" <sdesai@...> wrote:
            >
            > Hi,
            > Thanks for the detailed report.
            >
            > I'll try to reproduce your test case, but if you have a test page
            > already you can point us to, that would help. I'd like to see how the
            > time spent enforcing modality is broken up - the finding of elements,
            > the attaching of focus listeners etc. That said, I can see how the
            > current modal enforcement strategy would not scale well with a large
            > number of elements to "disable" (as a result of the above 2 steps).
            >
            > If you can file a bug for the issue, even better.
            >
            > I'll look into a workaround for you, but off the top of my head, it'll
            > probably require unsubscribing Panel's default "showMask" event
            > listener, and subscribing a patched version (or nothing at all, and
            > simply hiding the non panel focusable elements using CSS to maintain
            > modality).
            >
            > Regards,
            > Satyen
            >
          • brendangibson
            Satyen, Thanks for your quick response. The solution that you suggested in the bug solves my problem. I still find that IE slows down, but not so much that I
            Message 5 of 5 , Feb 26, 2008
            • 0 Attachment
              Satyen,

              Thanks for your quick response. The solution that you suggested in
              the bug solves my problem.

              I still find that IE slows down, but not so much that I am getting an
              alert. Safari and FF are snappy - (it's a pity so many of our users
              are still stuck with IE ...)

              I am glad you have been able to help me with this. I have been
              chasing this bug for a while, originally thinking it was the IE memory
              leak with event listeners, then the size of each of the images I was
              displaying in the panel. Finally I narrowed it down to the YUI panel.
              Without your help, I may have had to go back to marketing, grovelling
              on bended knee for a requirements change...

              Here is the modified code that works:

              /*Large image panel*/

              BCOUNT.pdp.large_image_panel_init = function () {
              // Instantiate a Panel from markup
              BCOUNT.large_image = new YAHOO.widget.Panel(
              "large_image_panel", {
              width:"506px", visible:false, modal: true,
              constraintoviewport:true, fixedcenter:true
              });

              BCOUNT.large_image.render();

              BCOUNT.large_image.showMaskEvent.unsubscribe();
              BCOUNT.large_image.hideMaskEvent.unsubscribe();


              BCOUNT.show_large_panel = function () {
              yd.setStyle('large_image_panel','display','block');
              BCOUNT.large_image.show();
              var scvli = new ScViewLargerImage();
              };

              BCOUNT.hide_large_panel = function () {
              BCOUNT.large_image.hide();
              };

              ye.addListener("enlarge_image_link", "click", function () {
              BCOUNT.show_large_panel(); }, BCOUNT.large_image, true);
              ye.addListener("main_product_image_link", "mousedown", function ()
              { BCOUNT.show_large_panel(); }, BCOUNT.large_image, true);
              ye.addListener("product_image", "mouseover", function () {
              BCOUNT.pdp_images.load_large_image(); });
              ye.addListener("close_large_image", "click", function () {
              BCOUNT.hide_large_panel(); } , BCOUNT.large_image, true);
              ye.addListener("large_image_panel_mask", "mousedown", function ()
              { BCOUNT.hide_large_panel(); }, BCOUNT.large_image, true);

              };
              /*End large image panel*/


              --- In ydn-javascript@yahoogroups.com, "Satyen Desai" <sdesai@...> wrote:
              >
              > See:
              >
              >
              http://sourceforge.net/tracker/index.php?func=detail&aid=1884118&group_id=165715&atid=836476
              >
              > However, your case maybe something different, since opening/closing
              the panel shouldn't result in the problem below unless elements
              > are getting added to the document each time you open/close.
              >
              > Are you maybe creating a new instances every time you open?
              >
              > Regards,
              > Satyen
              > ________________________________________
              > From: ydn-javascript@yahoogroups.com
              [mailto:ydn-javascript@yahoogroups.com] On Behalf Of brendangibson
              > Sent: Tuesday, February 26, 2008 7:36 AM
              > To: ydn-javascript@yahoogroups.com
              > Subject: [ydn-javascript] Re: Error: A script on this page is
              causing Internet Explorer to run slowly
              >
              > I am having a similar problem, though I only get it with IE.
              >
              > In my case it takes about 20 times of opening and closing the panel to
              > get the IE alert. I don't have quite as many elements on the page,
              > though I do have quite a few.
              >
              > Was anyone able to provide a workaround for this issue? Were Satyen's
              > thoughts good enough to follow through with?
              >
              > --- In ydn-javascript@yahoogroups.com, "Satyen Desai" <sdesai@> wrote:
              > >
              > > Hi,
              > > Thanks for the detailed report.
              > >
              > > I'll try to reproduce your test case, but if you have a test page
              > > already you can point us to, that would help. I'd like to see how the
              > > time spent enforcing modality is broken up - the finding of elements,
              > > the attaching of focus listeners etc. That said, I can see how the
              > > current modal enforcement strategy would not scale well with a large
              > > number of elements to "disable" (as a result of the above 2 steps).
              > >
              > > If you can file a bug for the issue, even better.
              > >
              > > I'll look into a workaround for you, but off the top of my head,
              it'll
              > > probably require unsubscribing Panel's default "showMask" event
              > > listener, and subscribing a patched version (or nothing at all, and
              > > simply hiding the non panel focusable elements using CSS to maintain
              > > modality).
              > >
              > > Regards,
              > > Satyen
              > >
              >
            Your message has been successfully submitted and would be delivered to recipients shortly.