Skip to content

Define jquery in require.js config #736

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

Open
alimanfoo opened this issue Oct 28, 2017 · 1 comment
Open

Define jquery in require.js config #736

alimanfoo opened this issue Oct 28, 2017 · 1 comment
Labels
type:Enhancement A proposed extension to the behavior of the project

Comments

@alimanfoo
Copy link

I was trying to view a notebook that used a javascript library (jstree) that had a dependency on jquery. When I load jstree via require, it goes looking for jquery, but because jquery is not defined in the require config, require tries (and fails) to load jquery from the wrong URL. I can work around this by manually calling require.config to define jquery, but it would seem better if nbviewer set this config with the correct URL from where jquery is already being loaded. Here's an example notebook illustrating the use case and workaround.

@parente
Copy link
Member

parente commented Jul 8, 2018

nbviewer pulls in JS assets from jupyter/notebook, but does not configure the jquery URL like the notebook page template does (https://github.com/jupyter/notebook/blob/fcf5f39606aa7d5810c53f20b7f6694d025f9259/notebook/templates/page.html#L37). Seems reasonable that it might configure require to point to the bundled jquery too (https://github.com/jupyter/nbviewer/blob/master/nbviewer/templates/layout.html#L77)

@parente parente added the type:Enhancement A proposed extension to the behavior of the project label Jul 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:Enhancement A proposed extension to the behavior of the project
Projects
None yet
Development

No branches or pull requests

2 participants