3 ms·
Most of the time you're using some framework on your site, and your neat little demo depends on that same framework. But what if later on you want to upgrade t
by miniatureape 16y ago
Most of the time you're using some framework on your site, and your neat little demo depends on that same framework.
But what if later on you want to upgrade the framework on your site, but it breaks the demo and its not worth fixing (for example, you're demoing proof of concept or a little study)? It's easier to keep the demo on its own site where you don't have to worry about conflicts with your main site js.
And sure, you should be keeping everything out of the global scope, but sometimes you have some legacy code, or maybe you don't know exactly how to do that, etc.
Other times it's a limitation of the CMS (You can't include scripts).
You could put it inline on your page, but its easier and less error-prone to toss it on its own page.
But yeah, if you're just making a stand-alone project page, you really shouldn't have the above problems.