6
Not really a problem, but a question that can solve several of my problems.
Let’s say I upload this CSS file to my website:
<link href='http://host-1.com/style.css' rel='stylesheet' type='text/css'/>
But if the host-1.com off the air? Is there any way to check this and use another file, example:
<link href='http://host-2.com/style.css' rel='stylesheet' type='text/css'/>
As if I meant to say so to my code:
//Carregar esse arquivo css
<link href='http://host-1.com/style.css' rel='stylesheet' type='text/css'/>
//Mas no caso dele não funcionar, carregue esse:
<link href='http://host-2.com/style.css' rel='stylesheet' type='text/css'/>
If it is a "mirror" you can include both, however, it will force the user to download both files when both are working.
– mau humor
If the CSS is WELL lean, and its load is so important, you can place it inline on the page (in a <style> block), ensuring it is always present. You just have to understand the cost of this: it doesn’t take advantage of caching on different pages, it will be loaded every time, and give a little more maintenance work (but not as much as they say). It’s not normal, but if the situation requires it, it’s not wrong how people exaggerate around.
– Bacco
@Bacco to tell you the truth, it takes a little older sites for maintenance and this is well used if Naum the most.. kkkk
– MagicHat