Welcome, Guest
Username: Password: Remember me

TOPIC: Internet Explorer and jQuery's $(document).ready() call.

Internet Explorer and jQuery's $(document).ready() call. 2 years 5 months ago #68190

  • HCI_Guy
  • HCI_Guy's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 20
  • Karma: 0
This isn't a LimeSurvey issue, per se, but it is definitely an issue when modifying questions and content at run-time.

I have a survey that works under browsers outside of IE. Apparently, I see that this is because IE cannot be trusted to correctly determine when the DOM is loaded, hence leading to a race condition if one calls
$.ready(function(){...});
on a long page.

What do other people do to get around this? I've seen a suggestion elsewhere to move
$.ready(function(){...});
to the end of the page, and another solution to actively poll and determine when the page is indeed ready (but it's an old page).

Does anyone have a good, unified way to go about doing this?

Thank you!
The administrator has disabled public write access.

Re: Internet Explorer and jQuery's $(document).ready() call. 2 years 5 months ago #68191

  • HCI_Guy
  • HCI_Guy's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 20
  • Karma: 0
FIXED.

Thanks to this site.

Rather than use
$(document).ready(function() {...your code...});
use instead
jQuery(function() {...your code...});

I'll put this in the documentation, and add a note about this being a requirement for IE to honor DOM loading, as others must at some point benefit from this too.
Last Edit: 2 years 5 months ago by HCI_Guy. Reason: Adding links and information.
The administrator has disabled public write access.

Re: Internet Explorer and jQuery's $(document).ready() call. 2 years 5 months ago #68202

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5279
  • Thank you received: 289
  • Karma: 246
Thanks for your feedback. Can you please open a ticket at our bugtracker as well so that our developers can have a look at it and maybe overwork the source code!?

Thanks!

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.293 seconds
Donation Image