﻿/// <reference path="../../Areas/LR_OAModule/Views/News/Form.js" />
/// <reference path="../../Areas/LR_OAModule/Views/News/Form.js" />

getMessage(1);
function getMessage(page)
{
   
    var lm = getUrlParam('lm');
    var key = getUrlParam('key');
    var lang = getCurLang();
    //alert(key)
    
   
    $.ajax({

        type: 'get',//可选get

        url: '/Source/ashx/newlist.ashx',//这里是接收数据的PHP程序

        data: { top: "20", lm: lm, key: key, len: "20", page: page, lang: lang },//传给PHP的数据，多个参数用&连接

        dataType: 'text',//服务器返回的数据类型 可选XML ,Json jsonp script html text等


        success: function (msg) {
            var lis = new Array();
            lis = msg.split('^');
            $("#page1").paging({
                pageNo: page,  // 当前页
                totalPage: lis[2],  // 总页数（可以用Math.ceil()向上取整来计算）
                totalSize: lis[1],  //总条数
                callback: function (num) {

                    getMessage(num);
                   // console.log('当前页:' + num);
                }
            })


            var lm = formatLM(lis[3]);
            $("#newlist").html(lis[0]);
            $("#newtitle").html(lm);
            $(".breadcrumb>li:last").html(lm)
           // $("#newti").html(lm);
            
        },

        error: function (msg) {

            
           
        }

    })
}
function unescapeHTML(a){
          a = "" + a;
          return a.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&").replace(/&quot;/g, '"').replace(/&apos;/g, "'");
     }
//获取url中的参数
function getUrlParam(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
    var r = window.location.search.substr(1).match(reg);  //匹配目标参数
    if (r != null) return decodeURI(r[2]); return null; //返回参数值
}