But it comes at a cost, too.
XMLHttpRequest is only supported by “modern browsers”. But since moderns browsers means any browser of the last five years I don’t care too much. When
XMLHttpRequest is not supported, I suppose I can’t rely on other useful stuff neither. The synchronous requests also mean that there might be a slight performance hit. But the advantages of synchronous includes outweigh this by far. Finally,
Update: Here is the code to the updated module. Using it is now as simple as this:
<script src="include-http.js"></script> <script> include.include("my.module"); myfunc(...); </script>