zoukankan      html  css  js  c++  java
  • js 获取后台数据

    【后台】
    public string s="hello";

    【前台】
    alert(' <%=s%>');

    代码实例:下面是一段分页的脚本代码,不过不提供分页功能只是呈现页数,页码,后台字段数据是:tpid,xm,pagecount,xcm

    <script type="text/javascript">
            var tpid = new Array();
            var xm = new Array();
            var j = 2;
            tpids = "<%=tpid%>";
            xms = "<%=xm%>";
            pagecount = "<%=pagecount%>";
            xcm = "<%=xcm%>";
           
            tpid = tpids.split(",");
            xm = xms.split(",");
            document.write('<marquee width="100%" behavior="scroll" direction="left" align="middle" border="0px" scrolldelay="250px">欢迎你浏览&nbsp;&nbsp;相册——'+xcm+'</marquee></div>');
            document.write("<div id='page_1' style='display:block' >");
            for (var i = 0; i < tpid.length; i++) {

                document.write('<img class="imgsrc" src=Handler.ashx?ImID=' + tpid[i] + ' alt="' + xm[i] + '" />');
                if ((i + 1) % 8 == 0 && i + 1 != pagecount) {
                    document.write('</div><div id=page_' + j + ' style="display:none" >');
                    j++;
                }
            }

            document.write("</div>");
            document.write("<div style='color: #fff; text-align:center' id='showys' >第1页,共" + pagecount + "页</div>");

  • 相关阅读:
    leetcode
    leetcode
    [Cocos2d-x + c++]Tableview使用总结
    Windows上安装huginn
    移动端性能测试工具PerfDog
    Centos7配置静态IP地址
    Loadrunner11录制手机APP脚本
    使用VirtualDub数视频时间
    Maven Windows安装和配置
    JMeter安装和配置
  • 原文地址:https://www.cnblogs.com/woshare/p/2762258.html
Copyright © 2011-2022 走看看