- Friends Plugin
- Enable Mastodon Apps Plugin
- Homepage
-
Caching of Downloaded Code: Testing Results
Today I did some experimenting with the caching of downloaded code (or On-Demand Javascript, whatever you want to call it). I’ve set up a small testing suite that currently tests 3 different ways of downloading code: script-tag insertion via DOM, XmlHttpRequest as a GET and XHR as a POST. These are my results for now:…
-
Better code downloading with AJAX
I’ve been playing with Code downloading (or Javascript on Demand) a little more. Michael Mahemoff pointed me at his great Ajaxpatterns in which he suggests a different solution: if (self.uploadMessages) { // Already exists return; } var head = document.getElementsByTagName(“head”)[0]; var script = document.createElement(‘script’); script.type = ‘text/javascript’; script.src = “upload.js”; head.appendChild(script); Via DOM manipulation a…