本文目錄一覽:
使用asp或者js實現將整個網頁生成為一張圖片
做個打印按鈕 就可以了 當點擊打印時可以將打印內容打印為圖片格式
不過萬一對方沒有打印機 那可能要開發一個類似圖片打印控件的東西讓客戶安裝
用asp或js獲取url參數
asp
%
dim myrequest
for each myrequest in request.QueryString
response.write myrequest”:”request.QueryString(myrequest)”br”
next
%
js
script
function getrequest(){
var locurl=location.href;
var start=locurl.indexOf(“?”);
var end=locurl.length;
if(start!=-1){
var tempstr=locurl.substring(start+1,end)
tempstr=tempstr.split(“”);
var temp;
for(var i=0;itempstr.length;i++){
temp=tempstr[i].split(“=”);
request[i]=temp;
}
}
}
var request=new Array();
getrequest();
for(i=0;irequest.length;i++){
document.write(request[i][0]+”:”+request[i][1]+”br”)
}
/script
怎麼樣利用ASP或者JS隱藏頁面中的視頻文件地址?
思路:
在html.asp中用script src=”js.asp”/script方式來顯示內容,在html.asp代碼中,設置一個session,在js.asp進行判斷,如果是設置的值就顯示正常內容,如果不是,就隱藏或顯示其它內容,在js.asp的結尾把session值改變,在html.asp和js.asp中都加一段代碼,使得遊覽器不緩存頁面只能做到簡單的隱藏,使用工具軟件可以看到源文件,示例代碼:
html.asp程序代碼:
%
Response.Expires = 0
Response.Expiresabsolute = Now() – 1
Response.AddHeader “pragma”,”no-cache”
Response.AddHeader “cache-control”,”private”
Response.CacheControl = “no-cache”
%
html
head
meta http-equiv=”Content-Type” content=”text/html; charset=gb2312″
title查看代碼 – ;/title
style
!–
td { font-family: Tahoma; font-size: 8pt; color: #000080; line-height: 150%;
border: 1 solid #666666; padding: 4 }
—
/style
/head
body
%
session(“haiwa”) = “hw”
%
div align=”center”
center
table border=”0″ cellpadding=”0″ cellspacing=”0″ width=”480″
tr
td id=”tmp”SCRIPT LANGUAGE=”JavaScript” src=”js.asp” id=”js”/SCRIPT/td
/tr
/table
/center
/div
/body
/html
js.asp程序代碼:
%
Response.Expires = 0
Response.Expiresabsolute = Now() – 1
Response.AddHeader “pragma”,”no-cache”
Response.AddHeader “cache-control”,”private”
Response.CacheControl = “no-cache”
if session(“haiwa”) “hw” then
response.write “//歡迎查看源文件”
response.end
end if
%
//高,這你都能看得出來。我沒有招了。。哈哈
document.write (“先做後想,先想後做,邊想邊做;只想不做,只做不想,不想不做。——世界是幾乎都被這六種人涵蓋了,如果作為個人能清楚的分析並看出自己屬於哪一類人,至少證明你自己是個聰明人。”)
%
session(“haiwa”) = “”
%
asp和JS怎麼結合使用
asp是服務器端腳本,js是瀏覽器的腳本,你通過asp決定頁面中有什麼,js決定如何根據用戶的動作做出響應,當然也可以通過post來響應用戶的請求。
你寫的js腳本中,盡量將asp% … %中輸出的內容作為參數來使用,函數中盡量保存一致。代碼寫的有問題,可能是思路沒對上,例如:
function jumpiframe(%=i%){
經過asp處理也許會變成:
function jumpiframe(1){
還是定義成:
function jumpiframe(frameid){
在調用處再提供參數:
jumpiframe(%=id%);
這樣好點。
原創文章,作者:小藍,如若轉載,請註明出處:https://www.506064.com/zh-hant/n/154788.html