inherit
*this CT deserves an achievement*
136400
0
Jun 25, 2021 18:23:00 GMT -8
Trill
hola
6,232
January 2009
ghbraingle
|
Post by Trill on Jan 22, 2011 8:05:10 GMT -8
I was wondering if there was a way to host scripts or CSS on multiple hosts, where if one host went down, the secondary host would start serving the codes. For example, I'll host all my codes on both Host111 and Host222. Normally, Host111 would be serving up the codes and Host222 would be there just in case if Host111 stopped working or deleted my files. Is there a way to have an automatic contingency plan for Host222 to start serving the codes if Host111 stopped? I was thinking it's possible to state a JS variable in the code of the first host; then a check to make sure that variable matches whatever it was (and not undefined, if the host went down) or else the second host would be called upon. Does that make sense? <script hosted on Host111> var checkhost = "keyword"; ...rest of the code from this script... </script> <script> if (checkhost != "keyword"){ document.write('<scr'+'ipt src="Host222"></sc'+'ript>'); </script> Would that be an efficient way to have a contingency system in case one host is unavailable? I'm probably overlooking something that would be a whole lot easier. And then, what about CSS files? Thanks!
|
|