Tag: Javascript
-
JavaScript Includes Revisited
I’ve given in in the JavaScript and Modules matter. I’m doing now what all the cool kids are doing: Using XMLHttpRequest synchronously to load external JavaScript files. This has the advantage that it works synchronously, a very important thing for includes. Therefore I don’t need callback and moduleLoadedhackery anymore. Also I have sensible error checking, i.e. I can notice…
-
Porting JavaScript to Internet Explorer
While porting a small AJAX application I wrote to Internet Explorer, I encountered a few problems: IE doesn’t like <script> tags without a matching closing tag. This is especially a problem if you use the src attribute and try to use an XHTML-like closing tag like this: <script src=”…”/> In this case IE doesn’t draw anything at all, since…
-
Loading Modules in JavaScript
One of the weaknesses of the JavaScript language is that it does not have the concept of “importing” or “including” other source files or modules. In client-side JavaScript as used in web browsers you have to include all JavaScript files you intend to use in the main HTML file like this: <html> <head> <title>…</title> <script…