%
Dim bSurvey
' 是否顯示調(diào)查表
const bID="1"
' 調(diào)查表的id
bSurvey=false
' 檢查調(diào)查表是否已經(jīng)顯示過.
if instr(request.Cookies("s"),":" bID ":")=0 then
' 如果調(diào)查表沒有顯示,更新Cookie
response.Cookies("s").expires = DateAdd("d",60,now())
' 設(shè)定Cookie過期時(shí)間60天.
response.Cookies("s").path = "/"
' 設(shè)定路徑.
response.Cookies("s") = request.Cookies("s") ":" bID ":"
' 寫入Cookie.
bSurvey=true
end if
%>
知道我們給每個(gè)調(diào)查表一個(gè)id的好處了吧?如果有多個(gè)彈出窗口,可以很容易控制彈出順序的。
再在頁(yè)尾加入下面的ASP代碼,用來判斷是否彈出窗口:
% if bSurvey then %>
script>
window.open("/survey/displaysurvey.asp?q="
' 用window.open()來打開新窗口.
bID,"SURVEY","width=350,height=400,top=0,left=0,scrollbars=yes")
/script>
% end if %>