Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: IPython is undefined toc.js:136:8 #45

Open
jkrajniak opened this issue Apr 20, 2015 · 3 comments
Open

TypeError: IPython is undefined toc.js:136:8 #45

jkrajniak opened this issue Apr 20, 2015 · 3 comments

Comments

@jkrajniak
Copy link

Hi,

I tried to install ToC extension but I am getting the error TypeError: IPython is undefined
toc.js:136:8.
IPython verson: 2.3.0

my custom.js file:

$([IPython.events]).on("app_initialized.NotebookApp", function () {
IPython.load_extensions("toc");
});

@jankatins
Copy link
Contributor

I think you IPython 2.x is not supported anymore. you could probably checkout a older version and try that version.

@jkrajniak
Copy link
Author

I tested on notebook server is 3.1.0-cbccb68, now there is something wrong with the code in custom.js;
Mainly on the js console I've got that ReferenceError: $ is not defined
When I typed IPython.load_extensions("toc"); in js console then the button appear.

@jkrajniak
Copy link
Author

Following adding the extension to custom.js the correct code that works for me is:

require(["base/js/events"], function (events) {
    $([IPython.events]).on("app_initialized.NotebookApp", function () {
            /* load your extension here */
            IPython.load_extensions("toc");
    });
}); 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants