addResource.js: add resources to the a web page (with callback)