It's all about optimization
Use Javascript to find elements on the page that require additional assets. If they exist, load them. If not, don't.