急!!!!!!!!!!!!!在线等!!!!!!!!1

grpifly 2004-04-01 12:07:37
为什么我的mypath参数在不能通过
<script>
function MM_jumpMenu(selObj){ //v3.0
var nn=selObj.options[selObj.selectedIndex].value;
var url="?mypath=<%=mypath%>&pageno="+nn;
window.navigate(url);
}
</script>
传到地址栏里呢??

全文:
-------------------------------
<!--#include file="config.asp" -->
<script>
function MM_jumpMenu(selObj){ //v3.0
var nn=selObj.options[selObj.selectedIndex].value;
var url="?mypath=<%=mypath%>&pageno="+nn;
window.navigate(url);
}
</script>

<%
mypath=request("mypath")
if mypath="" then mypath=" "
set rs=server.CreateObject("ADODB.RecordSet")
mysql="select * from N_artcle where Artcle_link='"&mypath&"'"
rs.Open mysql,conn,1,1
If rs.Eof or rs.Bof Then
response.write "<br><center>目前暂时还没有此类信息!"
response.end
else

mytitle=rs("Artcle_title")
%>
<table width="778" align="center" >
<tr>
<td align="center"><%=mytitle%></td>
</tr>
</table>

<%
end if
rs.close
set rs=nothing

%>

<%

pageno=cint(request("pageno"))
set rs2=server.CreateObject("ADODB.RecordSet")
Sql = "SELECT * FROM N_artcle "
rs2.open sql,conn,1,1
rs2.pagesize=10
mpage=rs2.pagecount

if pageno="" or pageno>mpage then
pageno=1
end if
if pageno<1 then pageno=1

rs2.absolutepage=pageno
loopno=10
do while not rs2.eof and loopno>0
response.write "m"

rs2.MoveNext
loopno=loopno-1
Loop

rs2.close
set rs2=nothing
conn.close
set conn=nothing
%>


  页次:[<%=cint(pageno)%>/<%=mpage%>]
<%
response.write pageno
%>

<% if cint(pageno)>1 then %>
<a href='?pageno=<%=(pageno-1)%>&mypath=<%=mypath%>'><font color="#FF0000">上一页</font></a>
<% end if %>
<%if (mpage>1 and cint(pageno)<cint(mpage)) then%>
<a href='?pageno=<%=(pageno+1)%>&mypath=<%=mypath%>'><font color="#FF0000">下一页</font></a>
<%end if%>
跳转:
<select name="goto" onChange="MM_jumpMenu(this)">
<% for pno=1 to mpage%>
<option value="<%=pno%>" <%if pno=cint(pageno) then%>selected<%end if%>><%=pno%></option>
<% next %>
</select>

<%
If Request.ServerVariables("REQUEST_METHOD")="POST" Then

if request("HyName")="" and request ("Hypassword")="" then
response.write "您还没有<a href=#>注册</a>"
response.end
end if
HyName = trim(ChkString(Request.Form("HyName"),"save"))
HyPassword = Request.Form("HyPassword")
HyText = trim(ChkString(Request.Form("HyText"),"save"))
HyIp=Request.ServerVariables("REMOTE_ADDR")

conn.Execute ("INSERT INTO N_discuss (HyName,HyPassword,HyText,mypath,HyIp) VALUES ('"& HyName &"','"& HyPassword &"','"&HyText&"','"&mypath&"','"&HyIp&"')")
'conn.close
'set conn=nothing
else

%>
<script>
function CheckForm() {

var errorMsg = "";

if (document.LatticeEditorForm.HyText.value==""){
errorMsg += "\n\t留言不能为空";
}

if (errorMsg != ""){
msg = "_____________________________________________________\n\n";
msg += "此信息不能提交,因为有一些内容还未填写.\n";
msg += "请按要求把内容填完再提交.\n";
msg += "______________________________________________________\n\n";
msg += "以下内容要求填写: -\n";

errorMsg += alert(msg + errorMsg + "\n");
return false;
}

}

</script>
<form name="LatticeEditorForm" method="post" action="" onSubmit="return CheckForm();">
<table width="778" height="193" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="26">会员代号:
<input name="HyName" type="text" size="10">
    密码:
<input name="HyPassword" type="password" size="15"></td>
</tr>
<tr>
<td><textarea name="HyText" cols="50" rows="10"></textarea></td>
</tr>
<tr>
<td><input type="submit" name="Submit" value="提交">
<input type="reset" name="Submit2" value="重置">
</td>
</tr>
</table>
</form>
<%end if%>
...全文
9 点赞 收藏 5
写回复
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
vvfish119 2004-04-01
var url="?mypath=<%=mypath%>&pageno="+nn
这样改一下试试看:
var url="?mypath="+"<%=mypath%>"+"&pageno="+nn
回复
redcard 2004-04-01
javasript是在客户端运行,asp(你用的是vbscript)是在服务器端运行,当然在页面加载时mypath参数不正确辣。
一般象这样要调用javascript函数的,都把函数的调用代码写在一个字符串里,用response.write打出来,注意要把原来javascript中的双引号改为单引号。
例如:
response.write("<script>function MM_jumpMenu(selObj){ //v3.0 var nn=selObj.opt[selObj.selectedIndex].value;var url='?mypath=<%=mypath%>
&pageno='+nn;window.navigate(url);}</script>")
回复
liuyingzi 2004-04-01
<script>
function MM_jumpMenu(selObj){ //v3.0
var nn=selObj.options[selObj.selectedIndex].value;
var url="?mypath=<%=mypath%>&pageno="+nn;
window.navigate(url);
}
</script>

java脚本里可以调用vb脚本的变量么?
回复
grpifly 2004-04-01
response.write("<script>function MM_jumpMenu(selObj){ //v3.0 var nn=selObj.opt[selObj.selectedIndex].value;var url='?mypath=<%=mypath%>
&pageno='+nn;window.navigate(url);}</script>")
??????????????????????????????????????、
response.write 里有mypath=<%=mypath%>
晕晕晕晕晕!
回复
grpifly 2004-04-01
为什么他的行?????????????
--------------------------------------
<%Response.Expires = 0
session("author")="Lattice"
if (not Instr(session("adminadminister_news"),"| 7|")>0 and session("adminadminister_news")<>"admin") or session("adminadminister_news")="" or session("chkuser")<>"!123_4567!" then
response.redirect "../newsadminlogon.asp"
else
%>
<!--#include file="../newsweb/config.asp" -->
<%
pmcount=25
Assort_id=Request.QueryString("Assort_id")
if Assort_id="" then
strNews=""
else
strNews=" and Assort_id=" & Assort_id
end if %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>...信息系统...</title>
<link rel="stylesheet" type="text/css" href="../inc/default.css">
<script>
var check=0
function checkall(form) { //v2.0
if(check==0){
for(var i=0;i<form.elements.length;i++)
{
var e=form.elements[i];
e.checked=true;
}
check=1;
chk.alt="全否";
}else{
for(var i=0;i<form.elements.length;i++)
{
var e=form.elements[i];
e.checked=false;
}
check=0;
chk.alt="全选";
}
}
var o=0;
function numcheck(form) { //v2.0
for(var i=0;i<form.elements.length;i++)
{
var e=form.elements[i];
if(e.checked)
o=o+1;
}
if (o==1){

B1.disabled=false;
B2.disabled=false;
}
else if(o==0){
B2.disabled=true;
B1.disabled=true;
}else{

B1.disabled=true;
B2.disabled=false;
}
o=0;
}

function formsub(i){
if (i==1){
document.new_form.action = "saveeditnews.asp";
new_form.submit();
}
if (i==2){
if (confirm('你真的要删除所选信息吗?\n删除后将不能恢复。\n\n是否确定?')){
document.new_form.action = "delnews.asp";
new_form.submit();
}
}
}

function MM_jumpMenu(selObj){ //v3.0
var nn=selObj.options[selObj.selectedIndex].value;
var url="?Assort_id=<%=Assort_id%>&Assort_name=<%=ToUrl(Assort_name)%>&pageno="+nn;
window.navigate(url);
}

function Assort_Select(assObj){ //v3.0
var a=assObj.options[assObj.selectedIndex].value;
if (a!=""){
var url="?Assort_id="+a;
window.navigate(url);
}
}
</script>
</head>

<body bgcolor="#ffffff" text="#000000" link="#000000" alink="#000080" vlink="#000000" topmargin="0" leftmargin="0">
<table width="740" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td> </td>
</tr>
</table>
<table width="740" cellspacing="0" cellpadding="3" border="0" align="center">
<tr>
<td bgcolor="#777777" align="right" height="10"> 
</td>
</tr>
</table>



<table width="740" cellspacing="0" cellpadding="0" border="0" align="center">
<tr>
<td width="170" valign="top" bgcolor="#dcdcdc" align="center">
<script language="javascript" src="left.asp"></script>
</td>
<td bgcolor="#ffffff" width="569" valign="top">
<table cellpadding="3" width="100%">
<tr>
<td valign="top">
<table border="0" width="100%" cellpadding="1" cellspacing="2" align="center">
<tr>
<td height="18" bgcolor="#003C84">    <font color="#FFFFFF">编辑/删除信息</font> <select name="select" onChange="Assort_Select(this)">
<%
Set rs = conn.Execute ("SELECT * FROM N_assort")
If rs.EOF Or rs.BOF Then
Response.Write "<option>还没有任何信息类别</option>"
else

Response.Write "<option>全部信息</option>"
do while not rs.eof
id=rs("assort_id")
Response.Write "<option value=""" & id & """"
if cint(assort_id)=cint(id) then response.write " selected"
response.write ">" & rs("assort_name") & "</option>"
rs.MoveNext
Loop
end if
rs.close
set rs=nothing
%>

</select> <input type="checkbox" name="chk" onClick="checkall(new_form);numcheck(new_form)">
<font color="#FFFFFF">全选/全否</font> </td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<form name="new_form" method="post">
<tr>
<td><%
pageno=request.querystring("pageno")
Sql = "SELECT Artcle_id,Artcle_setup,Artcle_link,Artcle_title,Artcle_date FROM N_artcle where instr(1,Artcle_setup,'1',1)<=0" & strNews & " ORDER BY Artcle_id DESC"
openrs rs,sql,1,1
rs.pagesize=pmcount
mpage=rs.pagecount
if pageno="" or pageno>mpage then
pageno=1
end if
If rs.Eof or rs.Bof Then
response.write "<br><center>目前暂时还没有此类信息!"
else
rs.absolutepage=pageno
loopno=pmcount
do while not rs.eof and loopno>0
Response.Write "<input type=""checkbox"" onclick=""numcheck(this.form)"" name=""Artcle_id"" value=""" & rs("Artcle_id") & """>·"
if instr(1,rs("Artcle_setup"),"3",1)>0 then response.write "<font color=""#FF0000"">[图文]</font>"
response.write "<a href=""../newshtml/" & rs("Artcle_link") & """ target=""_blank"">" & ChkString(rs("Artcle_title"),"unhtml") & "</a> [" & rs("Artcle_date") & "]<br>"

rs.MoveNext
loopno=loopno-1
Loop
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
%></td>
</tr></form>
</table>


</td>
</tr>

</table>
</td>
<td bgcolor="#000000" width="1" rowspan="2"> </td>
</tr>
<tr>
<td width="170" valign="top" bgcolor="#dcdcdc" align="center"> </td>
<td width="569" valign="top">
<table cellpadding="3" width="100%">
<tr>
<td bgcolor="#dcdcdc">

<input type="button" name="B1" value="编辑" onclick="formsub(1)" disabled style="height:20px;">
<input type="button" name="B2" value="删除" onclick="formsub(2)" disabled style="height:20px;">
  页次:[<%=cint(pageno)%>/<%=mpage%>]
<% if cint(pageno)>1 then %>
<a href='?Assort_id=<%=Assort_id%>&Assort_name=<%=ToUrl(Assort_name)%>&pageno=<%=(pageno-1)%>'><font color="#FF0000">上一页</font></a>
<% end if %>
<%if (mpage>1 and cint(pageno)<cint(mpage)) then%>
<a href='?Assort_id=<%=Assort_id%>&Assort_name=<%=ToUrl(Assort_name)%>&pageno=<%=(pageno+1)%>'><font color="#FF0000">下一页</font></a>
<%end if%>
跳转:
<select name="goto" onChange="MM_jumpMenu(this)">
<% for pno=1 to mpage%>
<option value="<%=pno%>" <%if pno=cint(pageno) then%>selected<%end if%>><%=pno%></option>
<% next %>
</select>
页 </td>
</tr>
</table>
</td>
</tr>
</table>



<table width="740" cellspacing="0" cellpadding="3" border="0" align="center">
<tr bgcolor="#EDEED4">

<td align="left" width="653" bgcolor="#003C84">
<p align="center"> <font color="#FFFFFF"> </font></p>
</td>
</tr>
</table>





</body>
</html>
<%end if
%>
回复
发动态
发帖子
ASP
创建于2007-09-28

2.8w+

社区成员

ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
申请成为版主
社区公告
暂无公告