JavaScript调用函数不需要对象
<html> <body> <script> function fSetTatle() { var date=new Date(); var month=date.getMonth(); if (month == 0) { month=12; } document.title=month+"月工资"; return month+"月工资"; } document.write(fSetTatle());//调用函数不需要对象 </script> </body> </html>