Java script is not executed on dialog page

Java script is not executed on dialog page

Hi!

I display a dialog via

$.mobile.changePage("Error.html", { role: "dialog" });

where Error.html is a separate page and it's being displayed fine. In the head of Error.html there's a script

if (window.console) {
            console.log("Test");
        }

The script runs fine when I manually navigate to Error.html but not when I display it as a dialog via mobile.changePage. What am I missing here?

Thanks!