zoukankan      html  css  js  c++  java
  • JS调用ASP

    html中用js调用ASP文件,实现静态页面动态显示,比如HMTL文章的动态新闻评论等

    ---简单版[调用代码,把他放哪儿,就在哪儿显示]--------

    <script language="javascript" src="asdf.asp"></script>

    -----asdf.asp文件----------
    <%
    Response.Write 
    "document.write(""hello"");" '根据自己需要处理相关东西!
    %>

    -------------------------------------------------------------------------------


    ---复杂版[调用代码,把他放哪儿,就在哪儿显示]--------

    <script language="javascript" src="asdf.asp?cname=spell"></script>

    -----asdf.asp文件----------

    <!--#include file="conn.asp"-->
    <%
    cname
    =request.QueryString("cname")
    turl
    =request.ServerVariables("URL")
    sql
    ="s elect gongsi from company where cname='"+cname+"'"
    rs.open sql,connstr,
    1,1
    do while not rs.eof
    Response.Write 
    "document.write("" <table width=100% border=0><tr bgcolor=#ECE9D8> "");"
    Response.Write 
    "document.write("" <td width=100>" & Rs("gongsi"& "</td> "");"
    Response.Write 
    "document.write("" </tr><tr height=3></tr></table> "");"
    'Response.Write(gsname)
    rs.movenext
    loop
    Response.Write 
    "document.write("""&turl&""");"
    %
    >


    资料来源:学网(http://www.xue5.com/),原文地址:http://www.xue5.com/itedu/200802/102963.html

  • 相关阅读:
    运营商公网
    任务管理器 的 服务与进程
    QQ通信原理及QQ是怎么穿透内网进行通信的?
    windows Telnet 客户端常用命令介绍
    redis优化
    shell反射
    USB安装centos6系统(centos7需要换软件)
    rocketmq双主模式
    golang数据类型与转换
    golang介绍
  • 原文地址:https://www.cnblogs.com/findw/p/1990757.html
Copyright © 2011-2022 走看看