Nested Dynamic Object Loading

This page contains the following function:

var url = '';
function() {
  var obj = document.getElementsByTagName('object').item(0);
  var newObj = document.createElement('object');
  newObj.setAttribute('type', obj.getAttribute('type'));
  newObj.setAttribute('data', url + obj.getAttribute('data'));

And the following tag:


The purpose of the script is to add a failover object with an absolute url, so if the local file is not available it will pull from the repository.

Unfortunately, the failover does not work with dynamically added objects and the content is always loaded. This would not be the behavior of the subobject had been statically in the page at load time.