新手 写了个js的页面代码,但是不起效果,想问下各位大侠是否是js写错了?
本帖最后由 sun61599536 于 2013-04-17 20:30:56 编辑 这个是页面代码
<%@ 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 XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<title>创睿微博_设置密码</title>
<base href="<%=basePath%>"/>
<meta http-equiv="keywords" content="创睿,微博,创睿软件技术,安徽创睿" />
<meta http-equiv="description" content="创睿微博注册" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link href="css/style_110303.css" type="text/css" rel="stylesheet"/>
<link href="css/style_110303_03.css" type="text/css" rel="stylesheet"/>
<script src="js/jquery-1.4.4.js"></script>
<script src="js/set_oneself_info.js"></script>
<script src="js/jquery.jSelectDate.js"></script>
<script type="text/javascript">
$("body").ready(function(){
//应用方法
$("input.date").jSelectDate({
css:"date",
yearBeign: 1800,
disabled : false
});
});
$(this).jSelectDate
</script>
</head>
<body>
<!-- begin 头部 -->
<div id="headWrap">
<h1 id="logo">
<a style="display:none;" title="t.ourchr.com" href="#">创睿微博</a>
</h1>
<div class="topMenu">
<span class="userName"><a title="adrian(@wuxw920)" href="page.do?pageNo=1">我的帐号</a></span>
<span><a href="#">设置</a></span>
<span><a href="login.jsp">退出</a></span>
</div>
<div id="nav">
<ul>
<li class="home"><a href="page.do?pageNo=1">我的主页</a></li>
<li class="people"><a href="#">找人</a></li>
<li class="topic"><a href="#">找广播</a></li>
</ul>
</div>
<div class=tSearch>
<form id=searchForm action="" method=get>
<label for=searchKey>搜名字/帐号/广播 </label>
<input class="inputTxt" id="searchKey" maxLength=50 name="k" autocomplete="off"/>
<input class="inputBtn" type=submit value="搜索"/>
<input type=hidden value="101" name="pos"/>
</form>
</div>
</div>
<!-- end 头部 -->
<div id="mainWrapper" class="clear">
<div class="tabStyle2">
<ul>
<li class="select"><b>个人资料</b></li>
</ul>
</div>
<div class="mainCnt">
<div class="main">
<form id="tableForm" action="setuserinfo.do" method="post">
<table class="tbList" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<th>账户:</th>
<td class="code">${loginUser.code }<a href="javaScript:void(0)" target="_blank" class="password"> 修改密码>></a></td>
</tr>
<tr>
<th><span>*</span>昵称:</th>
<td><input id="name" name="name" type="text" class="inputTxt en" value="${loginUser.name }"/>
<b class="pass" style="display:none"></b> <span class=""></span><br/>
</td>
</tr>
<tr>
<th><span>*</span>头像:</th>
<td>
<input id="homepage" name="homepage" type="file" class="en"/>
<b class="pass" style="display:none"></b> <span class=""></span><br/>
</td>
</tr>
<tr>
<th><span>*</span>真实姓名:</th>
<td><input id="realName" name="realName" type="text" class="inputTxt en" value="${loginUser.realName }"/>
<b class="pass" style="display:none"></b> <span class=""></span><br/>
</td>
</tr>
<tr>
<th><span>*</span>性别:</th>
<td class="fs14"><input name="gender" id="gender" value="2" type="radio"/>
<b class="pass" style="display: none;"></b>
<b></b> <label for="gender">女</label> <input name="gender" id="gender2" value="1" checked="checked" type="radio"/>
<label for="gender2">男</label><b></b>
</td>
</tr>
<tr>
<th><span>*</span>QQ:</th>
<td><input id="uqq" name="uqq" type="text" class="inputTxt en" value="${loginUser.uqq }"/>
<b class="pass" style="display:none"></b> <span class=""></span><br/>
</td>
</tr>
<tr>
<th><span>*</span>学校名称:</th>
<td><input id="uschool" name="uschool" type="text" class="inputTxt en" value="${loginUser.uschool }"/>
<b class="pass" style="display:none"></b> <span class=""></span><br/>
</td>
</tr>
<tr>
<th><span>*</span>现在的职业:</th>
<td><input id="uwork" name="uwork" type="text" class="inputTxt en" value="${loginUser.uwork }"/>
<b class="pass" style="display:none"></b> <span class=""></span><br/>
</td>
</tr>
<tr>
<th><span>*</span>联系电话:</th>
<td><input id="utel" name="utel" type="text" class="inputTxt en" value="${loginUser.utel }"/>
<b class="pass" style="display:none"></b> <span class=""></span><br/>
</td>
</tr>
<tr>
<th><span>*</span>博客地址:</th>
<td><input id="ubolg" name="ubolg" type="text" class="inputTxt en" value="${loginUser.ubolg }"/>
<b class="pass" style="display:none"></b>
<span class=""></span><br/>
</td>
</tr>
<tr>
<th><span>*</span>自我介绍:</th>
<td><input id="uinfo" name="uinfo" type="text" class="inputTxt en" value="${loginUser.uinfo }"/>
<b class="pass" style="display:none"></b>
<span class=""></span><br/>
</td>
</tr>
<tr>
<th></th>
<td>
<input type="button" class="inputBtn" value="保存" id="but"/>
<span class="left"><a href="javaScript:void(0);">取消</a></span></td>
</tr>
</tbody></table>
</form>
<div class="noteBox"><span class="red">*</span>为必填,完整的资料会为你带来更多关注</div>
</div>
<div class="side">
<div class="userDetail"><a href="" title="更改头像">
<img src="images/l00.jpg" alt="生手 写了个js的页面代码,但是不起效果,想问下各位大侠是否是js写错了"/></a><div class="clear"><span class="left">资料完整度</span><div class="infoRate" onmouseover="onMouseOverBar();return false;" onmouseout="onMouseOutBar();return false;"><span class="bg" style="width: 100%;"></span>
<a class="r1" href="#">100%</a></div></div></div>
<div class="sideNav clear" id="degreeBar"><ul>
<li class="select"><b>基本资料</b><em class="ico_suc" style="display: none;"></em><em style="display: inline-block;">>></em></li>
<li><a href="setting_password.html">修改密码</a><em style="display: none;">>></em></li>
</ul>
</div>
<div class="sideTips">
请完善基本资料、上传头像、这样可以为你带来更高关注度,帮你找到更多好朋友
</div>
</div>
<div class="botbor"></div>
</div>
</div>
<div id=Copyright>
<div class=wrapper>
<p><a href="http://www.ourchr.com/" target=_blank>创睿软件</a>|
<a href="#">意见反馈</a>
</p>
Copyright 2009 - 2011 ourchr. all Rights Reserved</div></div>
</body></html>
$(function(){
$("#but").bind("click",function(event){
var name = $("#name").val();
var realName = $("#realName").val();
var temp=document.getElementsByName("gender");
if(temp[0].checked){
var sex = 1;
}else {
var sex = 2;
};
var uqq = $("#uqq").val();
var uschool = $("#uschool").val();
var uwork = $("#uwork").val();
var utel = $("#utel").val();
var uinfo = $("#uinfo").val();
var ubolg = $("#ubolg").val();
$.ajax({
type:"post",url:"setuserinfo.do",
dataType:"text",
data:"name="+name,
async:true,
success:function(msg){
$.ajax({
type:"post",url:"setuserinfo.do",dataType:"html",
data:"name="+name+"&realName="+realName+"&sex="+sex+"&uqq="+uqq+"&uschool="+uschool+"&uwork="+uwork+"&utel="+utel+"&uinfo="+uinfo+"&ubolg="+ubolg,
async:false,
success:function(msg){
window.location='set_oneself_info.jsp';
}
});
}
})
return false;
});
});