Open stevenjoezhang opened 5 years ago
https://github.com/MoOx/pjax/blob/c26c223a652affd55677dd47619bc68017b8d5ca/index.js#L208-L213
https://github.com/MoOx/pjax/blob/c26c223a652affd55677dd47619bc68017b8d5ca/lib/execute-scripts.js#L10-L17
After script.parentNode.removeChild(script); is executed, script.parentNode will be null
script.parentNode.removeChild(script);
script.parentNode
null
https://github.com/MoOx/pjax/blob/c26c223a652affd55677dd47619bc68017b8d5ca/lib/eval-script.js#L4-L5
This means that the return value of the short-circuit evaluation here is document.querySelector("head")
document.querySelector("head")
In other words, all the scripts that are refreshed by pjax will be placed in the <head>. Is this expected behavior?
<head>
https://github.com/MoOx/pjax/blob/c26c223a652affd55677dd47619bc68017b8d5ca/index.js#L208-L213
https://github.com/MoOx/pjax/blob/c26c223a652affd55677dd47619bc68017b8d5ca/lib/execute-scripts.js#L10-L17
After
script.parentNode.removeChild(script);
is executed,script.parentNode
will benull
https://github.com/MoOx/pjax/blob/c26c223a652affd55677dd47619bc68017b8d5ca/lib/eval-script.js#L4-L5
This means that the return value of the short-circuit evaluation here is
document.querySelector("head")
In other words, all the scripts that are refreshed by pjax will be placed in the
<head>
. Is this expected behavior?