台灣最大程式設計社群網站
線上人數
933
 
會員總數:246138
討論主題:189722
歡迎您免費加入會員
討論區列表 >> 專欄文章 >> 匯出我的最愛
[]  
[我要回覆]
回應主題 加入我的關注話題 檢舉此篇討論 將提問者加入個人黑名單
匯出我的最愛
價值 : 0 QP  點閱數:1674 回應數:0
樓主

站務人員 站長
門外漢
0 1580
542 9
發送站內信

捐贈 VP 給 站務人員
此程式參考奇摩書籤做法

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=big5">

<title>匯出書籤</title>

</SCRIPT>

<script language="JavaScript">

<!--

function getMarks()

{

var thisform = document.form1;

path = location.protocol + "//你的WEB Server/123.asp"

window.external.ImportExportFavorites(false,path);

thisform.button.value = "匯出中...";

}

//-->

</script>

<script language="JavaScript">

<!--

function MM_openBrWindow(theURL,winName,features) { //v2.0

window.open(theURL,winName,features);

}

//-->

</script>

</head>

<body bgcolor="#FFFFFF" text="#064C53" alink="#CC0000" vlink="#2046C2" link="#2046C2">

<form enctype="multipart/form-data" method="post" name="form1">

<input type="button" value="匯出" onClick='getMarks()' name="button">

</form>

</body>

</html>


在123.asp裡,只要

<%

Str1 = Request.Form

%>

這樣就可接到匯出的書籤

回應者: Puck

<html>

<head>

<title>Untitled</title>

</head>

<body>

<%

'. ImportExportFavorites And ASP sample

Function BinaryToString(Binary)

Dim I, S

For I = 1 To LenB(Binary)

S = S & Chr(AscB(MidB(Binary, I, 1)))

Next

BinaryToString = S

End Function

If ucase(Request.ServerVariables("HTTP_User_Agent"))
= "POSTFAVORITES" Then 'IE sends favorites as POSTFAVORITES UA

dim ByteArray

'Read the favorites

ByteArray = request.binaryread(request.servervariables("HTTP_Content_Length"))

'Store the favorites In session

session("Favorites") = BinaryToString(ByteArray)

session("http") = request.servervariables("ALL_RAW")

end if

dim URL

const Message = "Click here to export And see your favorites/bookmarks"

URL = Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME")

'Write link with ImportExportFavorites And reload of the page.

Response.Write "
<a href=""javascript:{external.ImportExportFavorites(0,document.location.href);
window.location.reload();}"">"&Message&"</a>"

If session("Favorites")<>"" Then Response.Write " - your favorites are here."

'Write stored favotites

If session("Favorites")<>"" Then

Response.Write session("Favorites")

end if

%>

</body>

</html>
本篇文章發表於2001-04-30 00:00
目前尚無任何回覆
   

回覆
如要回應,請先登入.