HTML to use JS to invoke ASP files, to achieve static page dynamic display

Source: Internet
Author: User
js| Dynamic | static | show | page HTML with JS call ASP file, static page dynamic display, such as HMTL article Dynamic News Review

---simple version [calling code, where to put it, show where it is]--------

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

-----asdf.asp File----------
<%
Response.Write "Document.Write" ("Hello" ")"; ' According to their own needs to deal with related things!
%>
-------------------------------------------------------------------------------


---complex version [calling code, where to put it, where it appears]--------

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

-----asdf.asp File----------
<!--#include file= "conn.asp"-->
<%
Cname=request. QueryString ("CNAME")
Turl=request. ServerVariables ("URL")
Sql= "Select Gongsi from the company where Cname= '" +cname+ ""
Rs.Open sql,connstr,1,1
Do as 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& "" ");"
%>
--------------------------------------


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.