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

Can't call $script() to load files from within a loaded file #15

Closed
bmcclure opened this issue May 10, 2011 · 6 comments
Closed

Can't call $script() to load files from within a loaded file #15

bmcclure opened this issue May 10, 2011 · 6 comments
Assignees

Comments

@bmcclure
Copy link

I have a single line in my HTML file that calls $script('script'); in order to load my bootstrapper file which in turn calls $script() for all of my dependency files that I use.

Whenever I try to load something from within script.js, however, I get the following error:

'Uncaught TypeError: Cannot call method 'insertBefore' of null' from script.js on line 84

I could have sworn I had it working earlier, but now all I get is this error.

Any ideas what the cause could be?

@bmcclure
Copy link
Author

Actually, it seems I must have an error in the DOM somewhere perhaps... when I use it on a different page it is working.

This seems to be an issue on my end :)

@fat
Copy link
Collaborator

fat commented May 10, 2011

ok cool -- reopen if you run into anymore problems! thanks :)

@fat fat closed this as completed May 10, 2011
@bmcclure
Copy link
Author

Another update... $script fails with that error on any page where I'm using a Twitter widget with the code provided from their site. When I take the Twitter code out, everything works fine. When I put it back in, all my $script calls after the first one fail.

@ded
Copy link
Owner

ded commented May 10, 2011

oh. ha! I know exactly why this happens. I'll fix this. I also wrote the twitter widget. too funny.

@ded ded reopened this May 10, 2011
@ghost ghost assigned ded May 10, 2011
@ded
Copy link
Owner

ded commented May 11, 2011

this should be fixed with the latest patch d2cba2a#L0R9
the problem is that the twitter widget cleans up script nodes. Let me know if this is still happening.

@ded ded closed this as completed May 11, 2011
@bmcclure
Copy link
Author

Hey, thanks! I was worried I might not be able to use the Twitter widget along with $script(), but this was one of the fastest turnaround times on an issue I've had :)

Awesome work on this loader--it's my favorite so far, and I've been through a lot of them.

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

3 participants