• 将AJAX返回值纵向排序赋值给Table标签


    本人开发的开发者技术变现资源聚集地,大家支持下,下面是网址

    https://www.baiydu.com

        

    /*下面是所有拼接这个表的代码*/
    1
    function HandelAjaxReturnDataForContentTable(data) { 2 var shareHtml = ""; 3 var json = eval('(' + data + ')'); 4 var a, b, c, d, beginData 5 if (json.length > 0) { 6 beginData = json[0].Trem - 1 7 } else { 8 beginData = $("#contentTable tr td").eq(0).text().substring(0, 8) 9 } 10 var a, b, c, d; 11 shareHtml += "<table id='contentTable'><tr> <th colspan='2'><div class='fontcontentDiv'> 期号 开奖号 </div> </th><th colspan='2'> <div class='fontcontentDiv'> 期号 开奖号 </div> </th><th colspan='2'><div class='fontcontentDiv'> 期号 开奖号</div> </th><th colspan='2' ><div class='fontcontentDiv'> 期号 开奖号</div></th> </tr> "; 12 for (var i = 1; i <= 30; i++) { 13 for (var j = 1; j <= 4; j++) { 14 if (j == 1) { 15 a = beginData + i 16 } else { 17 b = a + 30; 18 c = a + 60; 19 d = a + 90 20 } 21 } 22 shareHtml += " <tr><td colspan='2'>" + a + "------- <a>*******</a></td><td colspan='2'> " + b + "------- <a>*******</a></td><td colspan='2'>" + c + "------- <a>*******</a> </td><td colspan='2'>" + d + "------- <a>*******</a> </td></tr>" 23 } 24 shareHtml += "</table>"; 25 $("#shareContentMasterDiv").empty(); 26 $("#shareContentMasterDiv").prepend(shareHtml); 27 var indexvalue = 0; 28 var jsonresult = ''; 29 if (json.length > 1) { 30 for (var i = 0; i < 120; i++) { 31 if (i <= 29) { 32 if (i == 0) {} else { 33 indexvalue = indexvalue + 4 34 } 35 } 36 if (i > 29 && i <= 59) { 37 if (i == 30) { 38 indexvalue = 1 39 } else if (i == 31) { 40 indexvalue = 5 41 } else { 42 indexvalue = indexvalue + 4 43 } 44 } 45 if (i > 59 && i <= 89) { 46 if (i == 60) { 47 indexvalue = 2 48 } else if (i == 61) { 49 indexvalue = 6 50 } else { 51 indexvalue = indexvalue + 4 52 } 53 } 54 if (i > 89 && i <= 119) { 55 if (i == 90) { 56 indexvalue = 3 57 } else if (i == 91) { 58 indexvalue = 7 59 } else { 60 indexvalue = indexvalue + 4 61 } 62 } 63 $("#contentTable tr td a").eq(indexvalue).text(json[i].Result); 64 if (json.length == i) { 65 return 66 } 67 } 68 } else {} 69 }

     本人创业做的一款androidApp, 下载量已经有2000多万,各种当前热门的网络手机奖励红包全部集成,另外还有热门电影和淘宝高额优惠券!很适合各类型的用户。

      

  • 相关阅读:
    IIS运行asp程序出现The requested resource is in use 和 安装.net 2.0 后运行2.0程序出现 Failed to access IIS metabase 错误的解决
    动态sql语句基本语法
    屏蔽浏览器关闭按钮及ALT+F4 快捷键
    [转]如何进行.NET高效开发
    HttpRuntime.Cache 与HttpContext.Current.Cache的疑问
    我搜集的关于工作流方面的技术文章
    [转]输入框自动完成,模仿IE的,支持FireFox
    javascript 的面向对象特性参考
    定义局部变量时,字符串不能超过8000的方法
    世联地产软件工程师笔试试题
  • 原文地址:https://www.cnblogs.com/xiaoliao/p/3628517.html
Copyright © 2020-2023  润新知