Adding opts.attrs and opts.text.#9
Conversation
|
+1 |
1 similar comment
|
+1 |
|
We could also just return the script DOM node, what you do with it is then up to you. Add text node, attributes. |
|
This would not add features for a small need. |
|
@vvo by then it's too late as the libs we're calling sometimes require attributes on the script tag that loaded them while the js is executing E.G. before |
|
But creating a script tag is synchronous compared to doing the actual script request. So if you add attributes right after using loadScript which returns the dom element, it should always work right? |
|
Maybe if there's a cached version you are screwed, dunno. |
|
I can see cases where |
|
If there is no way to hack around this then we should have the options. Separately, the PR needs to update the README with new features. |
8fb4b2f to
d8c5af3
Compare
|
@defunctzombie Also, if there is a way to hack around this then I'm completely open to it. |
|
@jsdevel As for the |
|
@vvo tests added for |
|
@vvo @defunctzombie are there any other tweaks you'd like me to make? |
|
LGTM |
|
👍 But I am no maintainer :) |
Adding opts.attrs and opts.text.
Tests fail on old IE (6,7,8). Please take a look and fix this up otherwise will have to revert since my goal with this is to have it work on all browsers. |
|
@jsdevel either setAttribute or createTextNode are failing I guess. |
|
Looking now... |
|
Firing up my vista VM to test in IE8... |
Some of the 3rd party libraries my team mates have been dealing with require text nodes in the script tag and / or attributes. This PR adds support for this.