使用ArtTemplate模板引擎搭配Ajax加载页面数据

有如下数据列表,现在使用ArtTemplate模板引擎,搭配Ajax加载页面数据 Ajax页面响应如下JSON格式的数据源: [ {"Id":1,"Name":"张三","Age":29}, {"Id":2,"Name":"李四","Age":27}, {"Id":3,"Name":"王五","Age":26}, {"Id":4,"Name":"赵六","Age":31}, {"Id":5,"Name":"钱七...


阅读正文

JS实现Base64加密解密、MD5加密、SHA1加密

<!-- base64加密解密 --> <script type="text/javascript" src="base64.js"></script> <script type="text/javascript"> var b = new Base64(); //加密 var str = b.encode("admin:admin"); alert("base64 encode:" + str);   //解密 str = b.decode(str); alert("base64 decode:" + str); </script> <!-- MD5加密 --> <script type="text/ecm...


阅读正文

Javascript省市区三级联动下拉框(非异步)

省市区数据变动少,我们可以基于JSON数据构建select控件中的选项,建立三级联动的下拉框,引用附件中的JS文件: whir.area.zip Html结构: <select id="selProvince"> <option value="">--请选择--</option> </select> <select id="selCity"> <option value="">--请选择--</option> </select> <select id="selDistrict"> <option value="">--请选择--<...


阅读正文

JS判断是否为手机访问

function isMobileDevice() { var sUserAgent = navigator.userAgent.toLowerCase(); var bIsIpad = sUserAgent.match(/ipad/i) == "ipad"; var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os"; var bIsMidp = sUserAgent.match(/midp/i) == "midp"; var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4"; var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb"; var bIsAndroid = sUserAgent.match(/a...


阅读正文