IE和Firefox,关于onchange()的问题! 页面源码!

lao_tou 2009-04-20 03:48:04
<%@ page language="java" contentType="text/html; charset=gbk"%>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html lang="true">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>团队网</title>
<link href="user/css/teamuser.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="user/js/hua.js" ></script>
<link href="css/label.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="user//user01/js/teamtab.js"></script>
<script type="text/javascript" src="user/js/label.js"></script>
<SCRIPT language="javascript">
var checkcc;checkcc=1;
function ck()
{
if(hid.style.display=="")
{hid.style.display = "none";}
else{hid.style.display="";
checkcc=2;}
}
</SCRIPT>
<script type="text/javascript">
<%-- 分页工具条JS --%>
function changePage(pageform){
pageform.submit();
}

function changePageSize(pageIndex){
if(pageIndex==0){return;}
var form1=document.getElementById("pageForm");
form1("pageVO.pageIndex").value=pageIndex;
if(form1("pageVO.pageIndex").value==""){
form1("pageVO.pageIndex").value=pageIndex-1;
}
form1.submit();

}
</script>
<script type="text/javascript">
var req;
x = new ActiveXObject("Microsoft.XMLDOM");
window.onload=function(){
}

function Change_Select(selectValue,target,str)
{

if(selectValue.value==-2){
document.userForm["teamVO.tname"].value="";
selectValue.value=-1;
document.userForm.submit();

}else{
var strUrl;

//查询城市list
if(target=='teamVO.cityId')
{
strUrl="pubAction.do?oper=searchArea&areaVO.superId="+selectValue.value;
}
else
{
if(selectValue.value=="-1")
document.userForm.elements[target].style.display ="none";
else
document.userForm.elements[target].style.display ="";
strUrl="http://localhost:8080/teamnet/pubAction.do?oper=searchTeamType&teamTypeVO.superid="+selectValue.value;
}
if(window.XMLHttpRequest)
{
req=new XMLHttpRequest();
}else if(window.ActiveXObject) {
try{
req = new ActiveXObject("Msxm12.XMLHTTP");
}catch(e) {
try{
req = new ActiveXObject("Microsoft.XMLHTTP");
}catch(e) {}
}
}
if(req)
{
req.open("GET",strUrl,true);
req.onreadystatechange=function()
{
if(req.readyState = 4)
{
if(req.status == 200)
{
parseMessage(selectValue.value,target,str);
}
else
{
alert("Not able to retrieve description"+req.statusText);
}
}
}
req.send(null);
}
}
}

function parseMessage(selectedValue,strTarget,str)
{
var n;
x.loadXML(req.responseText);
if(strTarget=='teamVO.cityId')
{
n=x.selectNodes("/select/area");
}
else
{
n=x.selectNodes("/select/type");
}
var select_root=document.userForm.elements[strTarget];
select_root.options.length=0;
select_root.options.add(new Option(str,"-1"));


if(selectedValue>0)
{
for(var i=0;i<n.length;i++)
{
var xValue=n[i].childNodes[0].firstChild.nodeValue;
var xText=n[i].childNodes[1].firstChild.nodeValue;
var option=new Option(xText,xValue);
try{
select_root.add(option);
}catch(e){
}
}
}
}
</script>

</head>

...全文
499 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
dpj666666 2010-05-06
  • 打赏
  • 举报
回复
非常需要!!!!!
sohighthesky 2009-04-20
  • 打赏
  • 举报
回复
刷新这个页面用了20分钟了,
你看下FF的错误控制台,哪里有错误找出来就好说了,有行号的
sohighthesky 2009-04-20
  • 打赏
  • 举报
回复
form1("pageVO.pageIndex").这种写法只支持IE,写成form1["pageVO.pageIndex"]
sohighthesky 2009-04-20
  • 打赏
  • 举报
回复
晕,刚才别人在用电脑

我用document.userForm["teamVO.tname"]这个出来怎么不为空?
lao_tou 2009-04-20
  • 打赏
  • 举报
回复
<body>
<logic:present name="userForm" property="teamVO.flg">
<script type="text/javascript">
<c:if test="${userForm.teamVO.flg=='1'}">
alert("申请成功,等待审批!");
document.location="./user.do?oper=gotoSearchTeam&teamVO.typeId=-1&teamVO.tname=&teamVO.subTypeId=-1";
</c:if>
<c:if test="${userForm.teamVO.flg=='0'}">
alert("申请失败!");
document.location="./user.do?oper=gotoSearchTeam&teamVO.typeId=-1&teamVO.tname=&teamVO.subTypeId=-1";
</c:if>
<c:if test="${userForm.teamVO.flg=='3'}">
alert("你已是该团队中的成员!");
document.location="./user.do?oper=gotoSearchTeam&teamVO.typeId=-1&teamVO.tname=&teamVO.subTypeId=-1";
</c:if>
<c:if test="${userForm.teamVO.flg=='2'}">
alert("已经加入该团队或申请过加入团队,不能重复申请!");
document.location="./user.do?oper=gotoSearchTeam&teamVO.typeId=-1&teamVO.tname=&teamVO.subTypeId=-1";
</c:if>
</script>
</logic:present>
<table width="100%" border="0" cellspacing="0" cellpadding="10">
<html:form action="user.do?oper=gotoSearchTeam" styleId="pageForm">
<tr>
<td >

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="3"><img src="user/images/dev_right_ml.gif" /></td>
<td width="150" align="center" background="user/images/dev_right_mm.gif" class="font_right_b">搜索团队</td>
<td width="6"><img src="user/images/dev_right_mr.gif" /></td>
<td background="user/images/dev_right_b.gif"> </td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tb_datalist">
<tr class="tr_detail02">
<td width="10"></td>
<td width="80">团队名称:</td>
<td width="115"><html:text name="userForm" property="teamVO.tname" ></html:text></td>
<td width="40">类别:</td>
<td width="115">
<html:select name="userForm" property="teamVO.typeId" onchange="Change_Select(this,'teamVO.subTypeId','--请选择子类别--')" styleClass="input_re">
<html:option value="-1">--请选择类别--</html:option>
<html:option value="-2">全部</html:option>
<logic:present name="userForm" property="teamTypeVOList">
<html:optionsCollection name="userForm" property="teamTypeVOList" value="typeId" label="typeName"/>
</logic:present>
</html:select></td>
<td width="110">
<html:select name="userForm" property="teamVO.subTypeId" style="display:none" styleClass="input_re">
<html:option value="-3">--请选择子类别--</html:option>
</html:select>
</td>
<td><input type="button" name="button" value="搜索" onclick="this.form.submit();"/></td>
<td width="120"> </td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tb_datalist">
<tr class="tr_detail">
<td>序号</td>
<td>名称</td>
<td>团队简介</td>
<td>人数</td>
<td>信誉等级</td>
<td>操作</td>
</tr>
<%int i=1; %>
<logic:present name="userForm" property="listModel">
<logic:iterate id="teamVO" name="userForm" property="listModel">
<tr class="tr_detail01">
<td><%=i %></td>
<td class="font_top_bl30"><a href="./pubAction.do?oper=gotoPubTeamInfo&teid=${teamVO.teId }" target="_blank"> ${teamVO.tname }</a></td>
<td>
<div style="width:225px;text-overflow:ellipsis;overflow: hidden;white-space:nowrap;">
${teamVO.note }
</div>
</td>
<td class="font_bottomlink">${teamVO.teanUserCount }</td>
<td class="font_bottomlink">
<c:if test="${teamVO.crId==1}">
一级
</c:if>
<c:if test="${teamVO.crId==2}">
二级
</c:if>
<c:if test="${teamVO.crId==3}">
三级
</c:if>
</td>
<td class="font_bottomlink"> <a href="./user.do?oper=applyJoinTeam&teamUserVO.teId=${teamVO.teId }&teamUserVO.tname=${teamVO.tname}"><img src="user/images/joingif.gif" /></a> </td>
</tr>
<%i++; %>
</logic:iterate>
</logic:present>
</table>


<logic:present name="userForm" property="pageVO">
<c:if test="${userForm.pageVO.resultTotal!=0}">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="5"><img src="user/images/table_bg_pagel.gif" /></td>
<td background="user/images/table_bg_pagem.gif" width="120"><a href="#"></a></td>
<td background="user/images/table_bg_pagem.gif" class="td_font_d">
第${userForm.pageVO.pageIndex}页/共${userForm.pageVO.pageTotal}页  共${userForm.pageVO.resultTotal }条记录  每页
<html:select name="userForm" property="pageVO.pageSize" onchange="changePage(this.form);">
<html:option value="5">5</html:option>
<html:option value="10">10</html:option>
<html:option value="15">15</html:option>
<html:option value="20">20</html:option>
</html:select>
行 <SPAN><A style="FONT-FAMILY: Webdings! important" href="#" onclick="changePageSize(1)">9 </A></SPAN><A style="FONT-FAMILY: Webdings! important" href="#" onclick="changePageSize(${userForm.pageVO.pageIndex-1})">7 </A>
<html:select property="pageVO.pageIndex" name="userForm" onchange="changePage(this.form);">
<c:forEach var="count" step="1" begin="1" end="${userForm.pageVO.pageTotal}">
<html:option value="${count}">${count}</html:option>
</c:forEach>
</html:select>
<SPAN><A style="FONT-FAMILY: Webdings! important" href="#" onclick="changePageSize(${userForm.pageVO.pageIndex+1})">8 </A></SPAN><A style="FONT-FAMILY: Webdings! important" href="#" onclick="changePageSize(${userForm.pageVO.pageTotal})">:</A>
</td>
<td width="5"><img src="user/images/table_bg_pager.gif" /></td>
</tr>
</table>
</c:if>
<c:if test="${userForm.pageVO.resultTotal==0}">
<table width="100%" border="0" cellspacing="0" cellpadding="4">
<tr align="center">
<td colspan="5"><font color="red">该类别暂时没有建立团队!</font>
</td>
</tr>
</table>
</c:if>
</logic:present>
</td>
</tr>
</html:form>
</table>


</body>
</html:html>

81,094

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧