var Wwidth = window.innerWidth ; window.addEventListener('resize', function() { ///宽度变化大于50像素的时候刷新整个窗口以适应新宽度 if ( Math.abs(Wwidth - window.innerWidth) > 50 ) { //如果不在编辑页面,则在窗口变化后刷新窗口以适应宽度 if(window.location.href.indexOf("/edit") === -1){ window.location.reload(); } }; }); //挂在window下的全局配置 window.DocConfig = { //"server":'http://127.0.0.1/showdoc/server/index.php?s=', //"server": window.location.protocol +'//'+ 'help1.doc.com' + window.location.pathname+ '../server/index.php?s=', "server": window.location.protocol +'//'+ window.location.host + window.location.pathname+ '../server/index.php?s=', //"lang" :'en' "lang" :'zh-cn' }