摘自https://www.cnblogs.com/andong2015/p/4313395.html




function hello(){

       console.log('hello')

}


改写为


window.hello=function(){

       console.log('hello')

}

Created with the Personal Edition of HelpNDoc: Write EPub books for the iPad