3 ms·
Semi-related, I don't understand why most JavaScript/HTML/CSS projects only have demonstrations tucked away on another page (or in the download package, or miss
by Sidnicious 16y ago
Semi-related, I don't understand why most JavaScript/HTML/CSS projects only have demonstrations tucked away on another page (or in the download package, or missing entirely).
This stuff works on the web, right? A demo is the first thing anyone should see when visiting your project.
- chime 16y agoA very good reason to put demo on a separate page is to simplify the implementation and make the html/css readable. I love demos where I can view-source, read the few pertinent lines of CSS/JS and have the library working within minutes. Putting demos on the main project page means going through non-essential site-specific code. E.g. see my http://chir.ag/projects/drop-search/ http://chir.ag/projects/drop-search/ project demo on: http://chir.ag/projects/drop-search/demo.shtml http://chir.ag/projects/drop-search/demo.shtml vs http://chir.ag/ http://chir.ag/ - the search works throughout my site but it's very easy to see how to implement it on the simple demo page.
- miniatureape 16y agoMost 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.