The following message is in my console when I try to add an external stylesheet to my BYOND game:
Removing disallowed element <LINK>
Why?
I just want to include Bootstrap, I'm not out to do something harmful.
The webclient manual (http://www.byond.com/docs/ref/webclient.html) does not mention this limitation.
Another issue I've been running into is that script files seem to be loaded asynchronously rather than synchronously. Another undocumented quirk or is it a bug?
ID:1980113
Nov 9 2015, 10:13 am
|
|||||||
Resolved
| |||||||
For anyone else running into this problem, this is my fix:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> |
Note that this does involve a lot of hassle on the developer, so if it's possible to load scripts asynchronously, or mark them as synchronous/important, this would be preferable to my alternative.
|
That's a darn good workaround though. Thanks for sharing it.
I'll see what I can come up with on my end. |
Thanks. I appreciate the compliment. :)
Because JavaScript is event-driven it's best to call functions with callbacks as opposed to waiting for a return value. The above approach is one I use frequently. Just be careful not to copy-paste that all over the place. If you add calls like this it's easy to get trapped in functions. (Functions in functions in functions in functions...) |
The async loading of scripts needs to be documented; it's correct behavior, but it isn't so much intentional as it is a natural consequence of how the page is loaded. There may be a way to force synchronous loading, so I'll look at that.