当前位置:主页 > 查看内容

如何制作一个弹出式的调查窗口?

发布时间:2021-04-20 00:00| 位朋友查看

简介:% Dim bSurvey ' 是否显示调查表 const bID="1" ' 调查表的 id bSurvey=false ' 检查调查表是否已经显示过 . if instr(request.Cookies("s"),":" bID ":")=0 then ' 如果调查表没有显示 , 更新 Cookie response.Cookies("s").expires = DateAdd("d",60,now()……

    <%
    Dim bSurvey 

' 是否显示调查表
    const bID="1" 

' 调查表的id

    bSurvey=false
    '
检查调查表是否已经显示过.
    if instr(request.Cookies("s"),":" & bID & ":")=0 then
   '
如果调查表没有显示,更新Cookie

      response.Cookies("s").expires = DateAdd("d",60,now())

      ' 设定Cookie过期时间60.
      response.Cookies("s").path = "/"

      ' 设定路径.
      response.Cookies("s") = request.Cookies("s") & ":" & bID & ":"

' 写入Cookie.

      bSurvey=true
    end if
    %>
   
知道我们给每个调查表一个id的好处了吧?如果有多个弹出窗口,可以很容易控制弹出顺序的。

再在页尾加入下面的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 %>

本文转载自网络,原文链接:https://m.jb51.net/article/4682.htm
本站部分内容转载于网络,版权归原作者所有,转载之目的在于传播更多优秀技术内容,如有侵权请联系QQ/微信:153890879删除,谢谢!

推荐图文


随机推荐