欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

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

程序员文章站 2023-01-25 17:37:02
    <%    dim bsurvey  ' 是否显...

    <%
    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 %>