zoukankan      html  css  js  c++  java
  • 动态输出javascript

    本页面定义为javascript.aspx

    <%@ Page Language="C#" AutoEventWireup="true" %>
    
    <%
        string protype = "var rows=[";
        for (int i = 0; i < 100; i++)
        {
            protype += "{name:'tich_" + i + "',values:'wabt" + i + "iso59-1'}"; if (i < 99) protype += ",";
        } protype += "];";
        Response.Clear();
        Response.ContentType = "text/javascript";
        Response.ContentEncoding = Encoding.UTF8;
        Response.Write(protype);
        Response.End();
    
    %>
    <!doctype html>
    <html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>动态输出javascript内容</title>
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
        <script type="text/javascript" src="javascript.aspx">
        </script>
    
    </head>
    <body>
        <script type="text/javascript">
            alert(rows.length);
        </script>
    
        <div id="content">
        </div>
    </body>
    </html>

    如果这篇文章对您有帮助,您可以打赏我

    技术交流QQ群:15129679

  • 相关阅读:
    MySQL
    MySQL -数据库备份
    MySQL
    MySQL
    MySQL
    MySQL
    MySQL
    MySQL
    MySQL
    53端口反弹shell
  • 原文地址:https://www.cnblogs.com/yeminglong/p/2652343.html
Copyright © 2011-2022 走看看