I have a question about Javascript. I create a web page (HTML+Javascript) and want to run script#1 if the user is online, or script#2 else. I have a small and bad idea:
if(navigator.online) { /*here I want: <script src="script#1.js"></script>*/}else {/*here I want: <script src="script#2.js"></script>*/}
Have you got a better idea?