⑴ 網頁中上一頁,下一頁,跳轉到。。的代碼是什麼要怎樣實現
你需要使用一種技術 叫做遠程腳本調用:
我給你貼出全文方法, 請參考:
遠程腳本調用(Remote Scripting)
-增強asp交互性,提高asp響應的一大利器
一. 綜述.
Remote Scripting(簡稱RS)是微軟採用java applet擴充asp功能的一項技術,RS技術給予了開發人員在同一頁面組合客戶,伺服器兩端功能的能力.
在動態網頁領域中,以往是採用vbscript,javascript在客戶端處理用戶界面,做一些提交(submit)前的預處理工作,要與伺服器端發生交互的話,必須將整個form內數據提交到伺服器端,伺服器端接收到提交的數據來做一些處理,再把處理結果返回到客戶端.
如果採用RS技術,客戶端程序與伺服器端發生交互就可以繞過表單提交(submit)這個過程,直接調用伺服器端的處理程序,然後得到返回結果在客戶端顯示.比如說,在一個網站的新用戶注冊時,往往需要填寫一個注冊表單,裡面都會包含 「用戶名」,」密碼」 等信息,填寫完成以後點」提交」按鈕,這個用戶注冊信息發送到伺服器上,伺服器檢測」用戶名」是否有重復,有則提示錯誤,沒有就新注冊一個用戶. 這樣在用戶填寫整個注冊表單的過程中,用戶並不知道自己的」用戶名」是否已經存在,要等到提交整個表單以後才能得到結果.而RS技術則可以在用戶剛填寫完」用戶名」時就搜索伺服器端資料庫,並得到是否有重復的結果,提示用戶要更換用戶名,這樣就可以保證整個注冊一次成功,減少了來回修改的時間,程序的交互性也由此提高.
RS技術能提高asp程序的響應速度(asp運行速度並沒有提高),因為普通方法必須提交整個表單(form),表單中不僅包含了用戶輸入的數據,也包括了客戶機地址,用戶瀏覽器,屏幕信息等等諸多數據,提交後再等待伺服器返回處理結果. 而RS技術繞過了表單提交的過程,直接調用伺服器上的程序,然後返回結果,這樣雖然在伺服器端處理這一塊還是和以前一樣,但由於去掉表單提交的過程,故而響應速度有所提高.典型的應用場合如:搜索,刷新等.
二使用Remote Scripting 技術
在 下載RS(最新版本1.0b,文件大小143KB),安裝後會在開始菜單增加」Microsoft Windows Script」快捷方式,其中含有示常式序和詳細文檔. RS被安裝在了c:\intepub\wwwroot\_ScriptLibrary 目錄下,主要由三個文件組成(Rs.htm,Rs.asp, rsproxy.class) 使用RS 有以下兩步:
1. 客戶端配置
客戶端配置是在要與伺服器端發生交互的頁面上進行,比如用戶注冊注冊時候填寫的個人資料的頁面register.htm
a. 建立一個javascript程序塊,引用rs.htm文件:
<SCRIPT LANGUAGE="JavaScript" src="RS.HTM">
//注意rs.htm文件的路徑
b.建立一個建立一個javascript程序塊,調用rs.htm裡面的函數RSEnableScripting():
<SCRIPT LANGUAGE="JavaScript">
RSEnableRemoteScripting(「.」);
//一定要和rs.htm的路徑對應,例如:rs.htm文件和當前程序在同一目錄,就
//用 RSEnableRemoteScripting(「.」),
//在上一級目錄用 RSEnableRemoteScripting(「..」) 如果在當前程序的子//目錄下,經過我的試驗沒有成功,不知道為什麼 ;-(
</script>
基本配置到此結束,在完成伺服器端配置後還要根據實際要求在客戶機寫上另外一些定製代碼,
2. 伺服器端配置
伺服器端配置是在你要調用的asp文件中進行的,比如說用戶注冊的時候是提交到register.asp,那麼下面這些配置就是在register.asp中進行.
a. 包含rs.asp文件:
<!--#INCLUDE FILE="RS.ASP"-->
b. 調用rs.asp文件中的方法 RSDispatch()
<% RSDispatch %>
c. 聲明方法,還是用戶注冊的例子,假如register.asp中的register函數用來執行實際的注冊過程,那麼就必須將這個方法聲明才能夠被register.htm所調用.
<SCRIPT LANGUAGE="JavaScript">
var public_description = new constructor(); //構造方法
function constructor()
{
this.methodName = functionName;//functionName是伺服器端asp文件中的函數
//methodName是把asp文件模擬成對象的方法名
//functionName必須在asp中實際存在,
//methodName可以自定義,在客戶端文件中就是用//這個名字來調用上面asp程序中的函數
}
function functionName()
{
//some code.
}
</script>
3. 示例:
下面用實際的例子來說明rs技術的實際用法,這個例子就是一個普通的用戶注冊,用戶在register.htm文件中輸入用戶名和密碼,register.asp負責將用戶名和密碼插入資料庫,如果成功返回一個」用戶成功注冊」的信息.因為是示例,所以沒有寫的很完善,只是演示如何使用RS技術.
注意:必須要把rs.asp,rs.htm,rsproxy.class這三個文件放在和register.htm,register.asp同一個目錄下
<html>
<body bgcolor="#FFFFFF" text="#000000">
<script language="JavaScript" src="rs.htm"></script>
<script language="JavaScript">RSEnableRemoteScripting(".");</script>
<!--引用rs.htm文件,使客戶端能夠調用伺服器上的asp程序-->
<script language=javascript>
var serverURL="register.asp"; //定義伺服器上asp程序路徑
var obj;
var username;
var password;
function register()
{
username=document.form1.username.value; //得到用戶輸入的用戶名,密碼
password=document.form1.password.value;
obj=RSGetASPObject(serverURL); //將伺服器上asp程序所在路徑模擬成為一//個對象,obj就成為這個模擬對象的實例
obj.register(username,password,callback,"obj");
//伺服器上asp程序中的函數就被作為這個//模擬對象的方法,可以被客戶端調用了!其//中username,password都是方法的參數,可//以傳遞任意多個參數,callback是伺服器//返回值在客戶端的處理程序,本例中使簡單//的用alert顯示
}
function callback(co) //callback中的co參數是包含伺服器返回值 //的一個對象,他不僅有return_value //這個屬性,還有status, message, context等諸多屬//性,具體請參考rs的文檔
{
alert(co.return_value);//顯示伺服器返回值,也就是 該用戶成功注冊的信息
}
</script>
<form name="form1" method="post">
用戶注冊<br>
<input type="text" name="username">
<br>
<input type="text" name="password">
<br>
<input type="button" value="注冊" onclick="register()">
</form>
</body>
⑵ 怎麼獲取跳轉頁的源碼
第一種:給segue標記個Identifier再用代碼觸發,要點:segue開始的那邊都連在View界面上,不上連上button上,要不點到就會跳轉,如下:再用代碼這樣觸發這個跳轉的segue,如:[:@"SegueName"sender:self];第二種:能過取得storyboard文件里的viewController再用常規方法跳轉,先設置storyboard里viewController的標志StoryboardID,如下:再用代碼這樣跳轉://UIStoryboard*board=[:@"MainStoryboard"bundle:nil];UIViewController*next=[[selfstoryboard]:@"IconView"];[:nextanimated:NO];註解的代碼等同於[selfstoryboard],不過[selfstoryboard]是官方寫好的sdk,如果你的Storyboard文件名字修改過就用上面的代碼自己載入.
⑶ 求一個ASP+ACCESS跳轉頁代碼
<!--#include file="top.asp"-->
<script language="JavaScript">
function Listbox1_HuLiguo1(Listbox1_url){
location=Listbox1_url;
for(var i=0;i<document.Listbox1.elements.length;i++){
document.Listbox1.elements[i].options[0].selected=true
}
}
//-->
</script>
<%
ServerName = Request.ServerVariables("SERVER_NAME")
Typeid = Request.QueryString("typeid")
If Typeid = "成人專輯" Then
If ServerName = "192.168.1.251" then
Response.Write ("<script>alert(' 建設中……');javascript:history.go(-1);</script>")
Response.end
If Hour(time) > 6 and Hour(time) < 22 Then
Response.Write ("<script>alert(' 錯誤!\n\n未經授權的訪問。');javascript:history.go(-1);</script>")
Response.end
End if
Else
If Request.Cookies("UserName")="" or Request.Cookies("UserName")=null Then
Response.Write ("<script>alert(' 錯誤!\n\n您還沒有登陸或登陸超時,請先登陸。');javascript:history.go(-1);</script>")
Response.end
End if
End if
End if
%>
<TABLE cellPadding="0" width="100%" border="0" ID="Table14" bgcolor="#FFFFFF">
<TR>
<TD vAlign="top" width="10%">
<table cellSpacing="0" cellPadding="0" width="100%" align="center" border="0" ID="Table4">
<tr><td vAlign="top"><!--#include file="login.asp" --></td></tr>
</table>
<table cellSpacing="0" cellPadding="0" width="100%" align="center" border="0" ID="Table5">
<tr><td vAlign="top"><!--#include file="updating.asp" --></td></tr>
</table>
<table cellSpacing="0" cellPadding="0" width="100%" align="center" border="0" ID="Table5">
<tr><td vAlign="top"><!--#include file="recommand.asp" --></td></tr>
</table>
</TD>
<TD vAlign="top" width="1" bgColor="#cccccc"><IMG height="1" src="images/spacer.gif" width="1"></TD>
<TD width="90%" vAlign="top">
<TABLE border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber2">
<TR>
<TD><IMG height="35" src="images/<%=typeid%>.jpg" width="262"></TD>
</TR>
<TR>
<TD Height="2"></TD>
</TR>
<TR>
<TD bgColor="#cccccc" colSpan="2"><IMG height="1" src="images/spacer.gif" width="1"></TD>
</TR>
<TR>
<%
MaxPerPage=10
dim totalPut
dim CurrentPage
dim TotalPages
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
dim sql
dim rs
sql="select * from movie where typeid='"&typeid&"' and lockmovie=False order by id desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<TR><TD align='center'><FONT color='#ff4800' size='3'><B> 該欄目沒有任何電影</B></FONT></TD></TR></TABLE>"
else
totalPut=rs.recordcount
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showpage totalput,MaxPerPage,""
showtitle
showpage1 totalput,MaxPerPage,""
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showpage totalput,MaxPerPage,""
showtitle
showpage1 totalput,MaxPerPage,""
else
currentPage=1
showpage totalput,MaxPerPage,""
showtitle
showpage1 totalput,MaxPerPage,""
end if
end if
end if
sub showtitle%> <tr>
<td width="100%"></td>
</tr>
<tr>
<td width="100%"><table border="0" cellpadding="0" cellspacing="1" style="border-collapse: collapse" width="99%" id="AutoNumber1" bordercolor="#6D6D6D">
<%
b=0
dim row_count
row_count=1
%>
<tr>
<%
do while not rs.eof
b=b+1%> <td width="50%" valign="top"><table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
<tr><td width="50%" colspan="2" height="8"></td></tr>
<tr>
<td width="25%"><table border="0" cellspacing="1" style="border-collapse: collapse" width="100%" id="AutoNumber1" bordercolor="#D8D8D8">
<tr>
<TD class=lightedge width=125><A href="Movie.asp?id=<%=rs("id")%>" target=_blank><img class=blackedge height=175 src=<%=rs("Pic")%> width=125 border=0></A></TD>
<TD vAlign=top>
<TABLE cellSpacing=0 cellPadding=1 width="100%" border=0>
<TR><TD class=dottedline colSpan=2><A href="Movie.asp?id=<%=rs("id")%>" title=<%=rs("Name")%> target=_blank><FONT color=#ff4800 size=3><B><%=rs("Name")%></B></FONT></A></TD></TR>
<TR><TD class=dottedline vAlign=top align=right width="19%"><FONT class=font_darkyellow>領銜主演:</FONT></TD>
<TD class=dottedline width="81%"><FONT class=font_gray><%=left(rs("Title"),14)%></FONT></TD></TR>
<TR><TD class=dottedline vAlign=top align=right><FONT class=font_darkgreen>導演</FONT>:</TD>
<TD class=dottedline width="81%"><FONT class=font_gray>夢幻空間</FONT></TD></TR>
<TR><TD class=dottedline vAlign=top align=right><FONT class=font_pink>語言對白</FONT>:</TD>
<TD class=dottedline width="81%"><FONT class=font_gray>中文字幕</FONT></TD></TR>
<TR><TD class=dottedline vAlign=top align=right><FONT class=font_darkgreen>影片格式</FONT>:</TD>
<TD class=dottedline width="81%"><FONT class=font_gray>Rmvb 視頻節目</FONT></TD></TR>
<TR><TD class=dottedline vAlign=top align=right><FONT class=font_pink>發布地區</FONT>:</TD>
<TD class=dottedline width="81%"><FONT class=font_gray><%=rs("Typeid")%></FONT></TD></TR>
<TR><TD class=dottedline vAlign=top align=right><FONT class=font_darkgreen>發布日期</FONT>:</TD>
<TD class=dottedline width="81%"><FONT class=font_gray><%=rs("Date")%></FONT></TD>
<TR><TD class=dottedline vAlign=top align=right><FONT class=font_darkyellow>觀看次數</FONT>:</TD>
<TD class=dottedline width="81%"><FONT class=font_gray><%=rs("Hits")%></FONT></TD>
</TR>
</TABLE>
</TD>
</tr>
</table>
</td>
</tr>
<tr><td width="50%" colspan="2" height="8"></td></tr>
<TR><TD bgColor=#999999><IMG height=4 src="images/spacer.gif" width=1></TD></TR>
</tr>
</table>
</td>
<% if row_count mod 2 =0 then%></tr>
<tr>
<%end if%> <%row_count=row_count+1
if b=10 then exit do
rs.movenext
loop
rs.close
set rs=nothing
%> </tr>
</table>
</td>
</tr>
<tr>
<td width="100%" bordercolor="#00BF00">
<div align="center">
<table cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr>
<td height="20" align="left"><table border="0" cellPadding="0" cellSpacing="0" width="99%" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#D8D8D8">
<tr>
<span lang="zh-cn"><td width="71%" height="18">
<%
end sub
function showpage(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
end function
function showpage1(totalnumber,maxperpage,filename)
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
Response.Write "共有影片:<font face=""arial"" color=""red"">"&totalnumber&"</font>部 當前頁:<font face=""arial"" color=""red"">"&CurrentPage&"</font>共<font face=""arial"" color=""red"">"&n&"</font>頁"
if CurrentPage<2 then
response.write "<font color='999966'>首頁 上一頁</font>"
else
response.write "<a href="&filename&"?typeid="&typeid&"&page=1&>首頁</a>"
response.write "<a href="&filename&"?typeid="&typeid&"&page="&CurrentPage-1&">上一頁</a>"
end if
if n-currentpage<1 then
response.write "<font color='999966'>下一頁 尾頁</font>"
else
response.write "<a href="&filename&"?typeid="&typeid&"&page="&(CurrentPage+1)
response.write ">下一頁</a> <a href="&filename&"?typeid="&typeid&"&page="&n&">尾頁</a>"
end if
response.write "</td>"
response.write "<form name=""Listbox1"">"
response.write "<td width=""12%"" height=""18"">"
dim n
%></TD><TD class="ChangePageClass1" align="right">選擇頁數</TD>
<TD class="ChangePageClass2" vAlign="bottom" align="right">
<select name="Menu_HuLiguo2" size="1" onchange="Listbox1_HuLiguo1(document.Listbox1.Menu_HuLiguo2.options[document.Listbox1.Menu_HuLiguo2.selectedIndex].value)">
<option>第<%=CurrentPage%>頁</option>
<%for j=1 to n%>
<option value="?typeid=<%=typeid%>&page=<%=j%>">第<%=j%>頁</option>
<%next%></select>
<%end function%></td>
</form>
</span></tr>
</table>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!--#include file="end.asp"-->
你不只是一般的蠢,要源代碼研究,這個復制過去就可以測試了自己學著寫.懶人一個
⑷ 如何取超文本瀏覽框跳轉後的網頁源碼
延遲(3000)下面加個
網頁操作1.初始化(
超文本
瀏覽框1.取
窗口句柄
())
試試
⑸ 求JS載入頁跳轉代碼
我剛好寫了這么一個js效果。
css部分:
.cdiv1{
position:absolute;
left:0px;
top:0px;
z-index:15000;
overflow:hidden;
z-index:9990;
background:rgba(000,000,000,0.3);
}
.cdiv2{
height:60px;
width:150px;
/*border:1pxsolidblue;*/
position:fixed;
top:45%;
left:50%;
z-index:9999;
margin-left:-75px;
-webkit-border-radius:10px;
text-align:center;
line-height:60px;
font-size:15px;
font-family:微軟雅黑;
}
.cdiv2div{
clear:none;
height:15px;
}
.show_div{
display:block;
width:100%;
min-height:50px;
height:auto;
background:rgba(255,255,255,1);
line-height:50px;
text-align:center;
border-radius:5px;
border:1pxsolid#ccc;
position:absolute;
z-index:1800;
}
js部分:
var_cdiv="",ktime;
functioncreatDiv(){
var_height=$(document.body).height();
var_width=$(document.body).width();
_cdiv+="<divclass='cdiv1'>";
_cdiv+="</div>";
_cdiv+="<divclass='cdiv2'>";
_cdiv+="<divid='showimgs'><imgsrc='../App_Themes/images/wait.gif'width='45px;'height='45px;'/></div>";
//_cdiv+="<div>載入中...</div>";
_cdiv+="</div>";
$(document.body).append(_cdiv);
$(".cdiv1").css("height",_height+"px").css("width",_width+"px");
}
functionshowDiv(){
if($(".cdiv1").attr("class")!=undefined){
$("#showimgs").html("<imgsrc='../App_Themes/images/wait.gif'width='45px;'height='45px;'/>");
$("#showimgs").removeClass("show_div");
$(".cdiv1").fadeIn(50);
$(".cdiv2").fadeIn(5);
}else{
creatDiv();
}
}
functionappendText(){
if($(".cdiv1")){
$("#showimgs").html("網路異常,請檢查網路");
$("#showimgs").addClass("show_div");
setTimeout(function(){hideDiv();},2000);
}
}
functionhideDiv(){
window.clearInterval(ktime);
$(".cdiv1").hide();
$(".cdiv2").hide();
}
functionstartDiv(){
ktime=setTimeout(function(){appendText();},15*1000);
showDiv();
}
調用方法:
startDiv();
載入完成後停止調用:
hideDiv();
效果圖:
//使用jq的延遲調用方法:jQuery.when。或者使用jq插件deferred(deferred.then),
deferred.then(state1).then(state2);//最後調用的是state2方法,那就在state2方法裡面停止效果
⑹ html跳轉代碼
這個就是了,測試了好多種的,這個是5秒之後跳轉的代碼,時間可以自己改
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>5秒後跳轉到另一個頁面</title>
</head>
<script>
var t = 5;
var s = '.';
timeID=setInterval("countDown()",1000);
function countDown(){
time.innerHTML= t +"秒後跳轉"+s;
t--;
s+='.';
if (t==0) {
location.href="http://www.51zuoyi.com/"; //【這邊是要跳轉的目標地址】
clearInterval(timeID);
}
}
</script>
<body>
<div><font ID="time" face="impact" color="#272822" size="7">即將跳轉</font>
</div>
</body>
</html>
把目標網址改為自己的就可以實現跳轉了,效果可以參考一下下面
⑺ 怎樣查看一個跳轉頁面的源代碼
在這個頁的前一個鏈接上點右鍵->目標另存為……
要是沒有鏈接,就直接把地址復制到迅雷或快車里下載下來,然後在本地就能看源代碼啦!
或者,動作快一點,在跳轉之前按一下瀏覽器上的「停止」按扭,也許就停在跳轉前的頁面了。
⑻ 一些頁面在pc端被跳轉了,怎麼看原來頁面的源代碼
在瀏覽器上看不了,跳轉之後載入的是跳轉之後的頁面的代碼。只能在項目裡面找跳轉之前的頁面源碼
⑼ 求一個php+smarty帶頁面跳轉的源碼demo
51CTO下載-PHP新聞發布系統源碼.rar
php製作,Smarty分離,mysql資料庫,帶後台管理。在wamp上親測可用。