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

Fix for out of order script loading #7670

Merged
merged 2 commits into from Nov 17, 2020

Conversation

davidfischer
Copy link
Contributor

There are two issues here:

  • The first issue is that a Sphinx theme sets defer or async when loading jQuery. This can cause jQuery to not be available before readthedocs-doc-embed.js sets its own $(document).ready event listener.
  • The second issue is caused by the sustainability API loading faster than the ad client. This should be rare since the ad client is loaded via a CDN but it can happen especially on slow networks.

I was able to reproduce these issues by setting throttling in the browser developer tools.

There are two issues here:

- The first issue is that a Sphinx theme sets defer or async
  when loading jQuery. This can cause jQuery to not be available
  before readthedocs-doc-embed.js sets its own event listener.
- The second issue is caused by the sustainability API loading
  faster than the ad client. This should be rare since the ad client
  is loaded via a CDN but it can happen especially on slow networks.

I was able to reproduce these issues by setting throttling
in the browser developer tools.
@davidfischer davidfischer requested review from ericholscher and a team Nov 16, 2020
Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks simple enough 👍

@davidfischer davidfischer merged commit d6933a7 into master Nov 17, 2020
3 checks passed
@davidfischer davidfischer deleted the davidfischer/out-of-order-scripts branch Nov 17, 2020
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

Successfully merging this pull request may close these issues.

None yet

2 participants