Refreshing Problem

I am working with mvc mobile application.Here I have implement mobile scheduler.But after click on button redirect to a specific action of a controller to load the view page where I configure the scheduler -

dhx.ready(function () {

        dhx.ui.fullScreen();

        dhx.ui({
            view: "scheduler",
            id: "scheduler"
        });

});

but its not open. After again refresh the page its open.Please help.

Make sure that dhx.ready function is called. This function is called on window onload:

dhx.ready(function () {
alert(“window onload”)

});