我看别人给了一段JS代码(好像是个引用吧)
不关放到哪个网页上都可以访问 那个网站的一个列表
这种事怎么做的
比如 <script language="JavaScript" type="text/JavaScript" src="../xw/article_js.asp?ClassID=4&IncludeChild=true&SpecialID=&ArticleNum=7&ShowType=1&ShowCols=1&ShowProperty=false&ShowClassName=true&ShowIncludePic=false&ShowTitle=true&ShowUpdateTime=true&ShowHits=false&ShowAuthor=false&ShowHot=false&ShowMore=false&TitleMaxLen=30&ContentMaxLen=200&Hot=false&Elite=false&DateNum=10&OrderField=ArticleID&OrderType=desc"></script>这种JS怎么做的

解决方案 »

  1.   

    <script language="JavaScript" type="text/JavaScript" src="../xw/article_js.asp?ClassID=4&IncludeChild=true&SpecialID=&ArticleNum=7&ShowType=1&ShowCols=1&ShowProperty=false&ShowClassName=true&ShowIncludePic=false&ShowTitle=true&ShowUpdateTime=true&ShowHits=false&ShowAuthor=false&ShowHot=false&ShowMore=false&TitleMaxLen=30&ContentMaxLen=200&Hot=false&Elite=false&DateNum=10&OrderField=ArticleID&OrderType=desc"> </script> 
    就是这段js放到html里 能显示显示出内容 (就是平常说的调用JS)
    这种JS是怎么做的?
      

  2.   

    比如<script language="javascript" type="text/javascript" src="a.html" ></script>a.html的内容为document.write("<b>This will show on your page</b>");这样就可以了。就是这个原理。显示在页面上的文字是通过js写上去的。
      

  3.   

    就这么做呗,你用js写一个输出一个html列表的代码,存成一个文件,然后在别的地方这样引用也一样的效果,有啥问题?复杂点就像这个东西,你用asp.net做的话,就根据参数生成js代码。
      

  4.   

    关键如果是aspx那就不行了
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="adduction1.aspx.cs" Inherits="adduction_adduction1" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
        <script type="text/javascript">        document.write('xx');</script>
        </div>
        </form>
    </body>
    </html>这样就没啥调用
      

  5.   

    你给的示例那也只是JS引用其中的SRC地址内是访问JSP页面 根据配置的参数而输出不同的JS。最长用的就是客服系统或者广告系统
      

  6.   

    关键是如何调用aspx呢 给个简单的例子就行
      

  7.   

    aspx的话,只要这一句:
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="adduction1.aspx.cs" Inherits="adduction_adduction1" %>其他后面的全部去掉。直接在下面写javascript也不要任何html标签比如:
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="adduction1.aspx.cs" Inherits="adduction_adduction1" %>
    document.write('xx');
      

  8.   

    JS调用页面
    JS生成页面