举个简单例子:首先新建use.js文件内容:function show(){ alert("aa");}
建html文件跟use.js放同目录下:
<html><head><script type="text/javascript" src="use.js"></script></head><body><input type="button" value="点击" onclick="show()"></body></html>