为什么我的js没有运行
这个代码有点长,不过都很容易懂,我是初学者,麻烦帮我看看为什么我的js没有运行起来
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<script language = "javascript" type = "text/javascript" src = "jquery-1.7.2.js"/></script>
<script language = "javascript" type = "text/javascript" src = "ajax.js"/></script>
<script language = "javascript" type = "text/javascript" src = "username.js"/></script>
</head>
<body>
<center>
<h3>测试ajax</h3>
<form action="#" method = "post">
<table>
<tr>
<td>用户名:</td>
<td><input type = "text" name = "username" id = "user_name"onchange="javascript:checkname()"></td>
<td><div id = "point_out"></div></td>
</tr>
<tr>
<td>密码:</td>
<td><input type = "password" name = "password" id = "user_password" onchange="javascript:password()"></td>
<td><div id = "point_out2"></div></td>
</tr>
<tr>
<td>再次输入密码:</td>
<td><input type = "password" name = "password2" id = "user_password2" onchange="javascript:checkright()"></td>
<td><div id = "point_out3"></div></td>
</tr>
</table>
</form>
</center>
</body>
</html>
js文件是这样的
function checkname(){
var username = document.getElementById("user_name").value;
var ajax = creatAjax();
var url = "/servlet/deal?p"+username;
ajax.open("GET",url,"true");
ajax.send();
ajax.onreadystatechange=function()
{
if (readyState==4 && ajax.status==200)
{
var res = ajax.responseText;
var con = "";
if(res == 1){
con = "恭喜,该用户名可以注册";
}else{
con = "对不起,请换其他用户名";
}