How to load a CSS file based on a URL or client?
问题 I have two CSS files in my Sencha touch application. Lets call them A.css and B.css . Based on the URL I want the application to load different CSS. Lets say URL 1 is www.website.com/#1 so for this I would like to load A.css . similarly URL 2 is www.website.com/#2 so for this I would like to load B.css Is it possible to load CSS dynamically based on the URL? 回答1: You can use JavaScript Regex for this. Very easy method: // For www.website.com/#1 if (/www.website.com\/#1/.test(window.location