This is a migrated thread and some comments may be shown as answers.

jQuery ready event fires before telerik completly renders

1 Answer 130 Views
Rotator
This is a migrated thread and some comments may be shown as answers.
Olivier Mangelschots
Top achievements
Rank 1
Olivier Mangelschots asked on 31 Oct 2008, 08:28 AM
Hello,

We are using the RadRotator and want to interact with it on the page uaing jQuery.

jQuery has a ready function that fires after tthe DOM is loaded.

This is our code :

 <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
function ScrollRotator()
{
var rotator1 = $find("<%=RadRotatorLatestRegulatoryUpdates.ClientID%>");
}

window.onload = ScrollRotator;  // works
$(document).ready(ScrollRotator);        // does not work in IE, but does in FF
</telerik:RadScriptBlock>



Apparently the rotator1 variable will not be set to the RadRotator control in IE if we use jQuery.

In firefox ze get the expected behaviour.

Is RadRotator injecting HTML after the DOM is loaded so that jQuery cannot find it?





1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 03 Nov 2008, 02:49 PM
Hello Olivier,

No, but it seems that document.ready is not called at the same time in every browser. In scenarios like this I would suggest to use the ASP.NET AJAX's pageLoad() function. In addition, RadRotator, being an ASP.NET AJAX control, is loaded after MS AJAX's Init().



Best wishes,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Rotator
Asked by
Olivier Mangelschots
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or