Skip to content

Script src is not loaded when appended with $ #19

@JessicaSachs

Description

@JessicaSachs

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions