main.jsp:
<html>
<head>
<script type="text/javascript" src="hello.js">
</script>
</head>
<body>
<input type="button" value="test" onclick="hello(this.value)" />
<a onClick="bbb(this)">bbb_ok</a>
<a href onClick="bbb(this)">bbb_ok</a>
<a href="javascript:hello(aa.innerHTML)" id="one">oneoneone...</a>
<script>
var aa = document.getElementById("one");
</script>
</body>
</html>
hello.js
function hello(aaa){
alert(aaa);
alert("haha你好 ");
}
function bbb(str){
alert(str.innerHTML);
}