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

JS code insdie <script> tags is not exectued #92

Open
joelostblom opened this issue Dec 2, 2020 · 0 comments
Open

JS code insdie <script> tags is not exectued #92

joelostblom opened this issue Dec 2, 2020 · 0 comments

Comments

@joelostblom
Copy link

joelostblom commented Dec 2, 2020

Originally reported in my comment here ines/course-starter-python#4 (comment), but I realized that this is a more general issue that also affects the spacy course, not just the Python course starter. It seems that js code included in slides via <script> tags is not executed correctly in the spacy course framework. I tried in the latest version of this GitHub repo by modifying the first slideshow (chapter1_01_introduction-to-spacy.md) to include the following just under the bullet points:

<script>console.log('This does not work')</script>

Nothing is written to the console and no errors are raised either. This is not a problem with reveal.js because downloading their example slideshow and including the same code in the index.html works just fine (more elaborate examples such as vegalite plots also work fine in reveal.js).

Curiously, it seems that javascript is enabled and working fine in the spacy course slides, because <noscript> tags do not execute either and if I include the same js as part of a button, the console does correctly show log messages when this button is pressed:

<button type="button" onclick="console.log('This works')">Click me</button>

However, if the button references as function that has been defined inside <script> tags, the console throws an error that the function is not defined.

<script>
function myFunction() {
  console.log('This does not work either')
}
</script>

<button type="button" onclick="myFunction()">Click me too</button>

I thought this meant that the <script> tags were filtered out from the source file at some point, but if I highlight the text in a slide and click "View source for highlighted", I can see that they are still there, so there must be something wrong elsewhere such as in their execution.

I tried grepping this git repo for anything related to these tags or the slides, but I didn't see anything that seemed to indicate that script js code execution was disabled. I am not familiar with js so I would very much appreciate how to troubleshoot this further. Eventually, I want to use this for displaying Vegalite plots and the old workaroudn for this did not work for me, probably because vegalite has changed how the plots are displayed and the jupyter plugin has been deprecated as it is no longer needed.

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

1 participant