$(document).ready not firing when opening new page?

3 posts, 1 answers
  1. Jay
    Jay avatar
    65 posts
    Member since:
    Dec 2011

    Posted 15 Apr 2015 Link to this post

    I'm using the NavigateUrl to open a new page. That new page contains some javascript like

    $(document).ready(function () {
    The alert dialog never displays when the window is opened.

    Should I not expect the ready function to fire? Is there an alternative? I'm (re)using this window to open many different pages, but only one is trying to use the ready function.


  2. Answer
    Marin Bratanov
    Marin Bratanov avatar
    3908 posts

    Posted 16 Apr 2015 Link to this post

    Hi Jay,

    RadWindow loads its content page only when it is first shown. Thus, if the page has a proper reference to jQuery, the alert should fire. Could you try loading the same content page in a simple iframe through its src attribute to see if the alert fires as expected? If not, then the issue would be somewhere between the iframe and jQuery and not lie with RadWindow.

    Also, can you confirm there are no script errors in the browser console, as this can prevent scripts from running?

    Another thing I can suggest is setting the ReloadOnShow property of the RadWindow to true, so each time it opens it will append a random querystring to the page URL so you will always have a GET request for the content page.


    Marin Bratanov

    See What's Next in App Development. Register for TelerikNEXT.

  3. Jay
    Jay avatar
    65 posts
    Member since:
    Dec 2011

    Posted 16 Apr 2015 in reply to Marin Bratanov Link to this post

    Thanks, Marin. That was the issue, the jQuery reference wasn't properly initialized.
Back to Top