regebro / impress-console

Speaker notes for impress.js
MIT License
133 stars 28 forks source link

impress-console doesn't work if I don't initialize it. #4

Closed ridom closed 11 years ago

ridom commented 11 years ago

Hi @regebro !

I am trying to use impress-console.js on an impress document but when I press

it returns consoleWindow is null: consoleWindow.document.open();

I set up the console like this:

<script src="js/impress.js"></script>
<script src="js/impressConsole.js"></script>
<script>
        $.ajax({
           type: "GET",
           url: "initImpress.js",
           dataType: "script"
         })
<script>

in initImpress.js I have:

setTimeout(function() {
    impress().init();
    console().init(css="css/impressConsole.css");
}, 3000);

Would you have an idea of where the problem come from?

Thanks!

regebro commented 11 years ago

OK, this is probably the tenth time I try to formulate a response to this, but I keep failing. So here comes the direct and brutal answer. I'm sorry if it seems a bit crude and aggressive:

I have no idea what you are doing or why, nor what you expect to happen. Try using the code from the documentation:

<script src="js/impress.js"></script>
<script src="js/impressConsole.js"></script>
<script>
    impress().init();
    console().init();
    console().open(); // If you want them to open automatically
</script>

Try that and see what happens.

ridom commented 11 years ago

Thank you for this quick answer! Ok sorry I didn't be explicit. And sorry for my english.

I have put on-line for you to see why and what for:

http://www.brazilian-way.com/spacemapp/index7.html#/tiny48

We can see that when the console is loaded, the remote doesn't work anymore and returns console.log is not a function but if I comment:

<script src="js/impressConsole.js"></script>

The remote is available and works fine. Maybe this is element to solve the problem but I don't see where the bad point is...

Hope you understand better now!

regebro commented 11 years ago

"The remote"? What remote? You are still very much not explicit. I still have no idea what you are trying to do, or what the problem is, except that clearly your first question didn't have anything to do with it. I'm closing this. If you can come with an actual bug report, please open a new ticket.