A question about executeScripts #208

Closed
opened 2019-08-03 01:43:23 -05:00 by stevenjoezhang · 0 comments
stevenjoezhang commented 2019-08-03 01:43:23 -05:00 (Migrated from github.com)

c26c223a65/index.js (L208-L213)

c26c223a65/lib/execute-scripts.js (L10-L17)

After script.parentNode.removeChild(script); is executed, script.parentNode will be null

c26c223a65/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?

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` 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?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: iLoveElysia/pjax#208