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

Script src is not loaded when appended with $ #19

Open
JessicaSachs opened this issue Jan 31, 2018 · 0 comments
Open

Script src is not loaded when appended with $ #19

JessicaSachs opened this issue Jan 31, 2018 · 0 comments

Comments

@JessicaSachs
Copy link

JessicaSachs commented Jan 31, 2018

When updating a script node that was previously appended to the DOM with a url, no network request is made.

  1. Append script node to document
  2. Find script node with selector
  3. $node.attr('src', someUrl);

Observe: No network request for someUrl is made in the browser's network tab
See example of jquery handling this: https://jsfiddle.net/w1gg6dgm/

This lack of functionality is manifested in a few different ways...
Appending a script node that already has a src attribute set never requests the file at src.

Example:

const $node = $('<script src=${url}></script>');
$('body').append($node); // should cause the script src to be loaded.... it doesn't
@JessicaSachs JessicaSachs changed the title Script is not loaded after script node is updated with src attribute. Script src is not loaded when appended with $ Jan 31, 2018
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