//往上滑是调用分页
function Ajax(currPage, pageSize) { // ajax后台交互String currPage,String pageSize
var el, Plist, i;
el = document.getElementById('thelist');
var cancle = function(options) {
var pattern = '${pageContext.request.contextPath}/integralParadise/userIntegralRecordsPaging?currPage=:currPage&pageSize=:pageSize';
for ( var key in options) {
pattern = pattern.replace(':' + key, options[key] || '');
}
return pattern;
} $.post(cancle({
currPage : currPage,
pageSize : pageSize
}), function(result) {
var integralRecord = result.page;
if (integralRecord.length > 0) {
$("#currPage").val(result.currPage + 1);
$("#pageSize").val(result.pageSize);
//追加信息
var divItem = "";
$.each(integralRecord, function(index, detail) {
if(detail.integral != 0){
var type = detail.typeId;
var integral = detail.integral;
var now = new Date(detail.operatorTime);
var time = now.Format("yyyy-MM-dd");
var positiveOrNegative =detail.positiveOrNegative ;
var operation = detail.operation;
var money = parseInt(detail.money);
var rate = detail.rate;
var name;
switch (type)
{
case 1:
name="账号绑定奖励";
break;
case 2:
name="出借奖励";
break;
}
divItem += "<div class='dtb_item'><div class='dtb_l'><h3>" +name+ "</h3><p>"+time+"</p></div><div class='dtb_m'>";
if(type == 11){
divItem +="<p class='i_msg purple'>" +"+"+integral+"</p></div></div>";
}else if(positiveOrNegative == false){
divItem +="<p class='i_msg green'>" +"-"+integral+"</p></div></div>";
}else{
divItem +="<p class='i_msg red'>" +"+"+integral+"</p></div></div>";
}
}
});
$("#thelist").append(divItem);
$(".pullUpLabel").html("")
myScroll.refresh();
} else {
$('.pullUpLabel').html('没有更多记录');
<c:if test="${showmessage <= 0 }">$("#dateTip").html("2016年9月7日前的记录暂时无法显示");</c:if>
}
});
}

这段代码最后用了JSTL和EL,但是这个段JS是在JSP页面中,如果JS不在JSP中要再JS设定使用该JS的JSP页面。

也就是说服务器端把JSTL和EL的值先转化后传到JS中,JS已经得到了静态的值来执行。

 <c:if test="${showmessage <= 0 }">$("#dateTip").html("2016年9月7日前的记录暂时无法显示");</c:if>

获取EL的值

var result = "${showmessage}"; 

JS中也可以使用JSTL和EL标签的更多相关文章

  1. JSP中 JSTL和EL标签的使用

    使用JSTL前的准备 想要使用JSTL,首先需要给工程导入JSTL的包(JSTL.jar和standard.jar). JSTL简介 JSP标准标签库(JSTL)是一个JSP标签集合,它封装了JSP应 ...

  2. js中使用s(c)标签

    在js或者jquery中使用s标签,其实并不难理解,s标签也只是一个标签而已,当你想象成js+s标签=js+html标签就理解了 例如: <script type="text/java ...

  3. jsp中引用的jstl 和fmt标签-详解

    JSTL 核心标签库标签共有13个,功能上分为4类: 1.表达式控制标签:out.set.remove.catch 2.流程控制标签:if.choose.when.otherwise 3.循环标签:f ...

  4. IDEL中easyui使用jstl和el出现传值不显示的问题

    <%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding=& ...

  5. js中特殊转换字符为html标签

    function htmlEncode(text){ return text.replace(/&/g,'&amp').replace(/\"/g,'&quot'). ...

  6. js中全局变量修改后的值不生效【jsp页面中各个js中内容的加载顺序】

    一个老项目中,一个jsp文件中有很多个js文件, 现在要在页面上的一个地方判断一个状态,因为一直找不到原来是在哪里修改的那个状态,所以决定不找了,而是在比较靠前引入的一个js中定义一个全局变量,然后在 ...

  7. JS中try catch的用法

    在js中也可以使用try/catch语法,把可能发生异常的代码使用try包裹起来,然后在catch中对异常进行处理,处理后就不会影响后面代码的执行. const a = null try { cons ...

  8. 转:el表达式获取map对象的内容 & js中使用el表达式 & js 中使用jstl 实现 session.removeattribute

    原文链接: ①EL表达式取Map,List值的总结 ②在jsp中使用el表达式通过键获得后台的一个map<Long,String>的值 ③在javascript中使用el表达式(有图有真相 ...

  9. JSTL、EL、ONGL、Struts标签的区别与使用

     一.JSTL 来源 我们使用JSP开发信息展现非常方便,也可嵌入java代码用来实现相关逻辑,但同样带来了很多问题: jsp维护难度增加 出事提示不明确,不容易提示 分工不明确等 解决上面的问题可以 ...

随机推荐

  1. 使用面向 iOS 的本机插件扩展 PhoneGap

    本文细致探讨了 Xcode(以 iOS 设备为目标)中的 PhoneGap(也称为 Apache Cordova)应用程序本机插件.如果您刚开始接触 PhoneGap 或者需要回顾 PhoneGap ...

  2. spark发行版笔记4Spark Streaming事务处理彻底掌握

    Spark Streaming事务处理彻底掌握 感谢DT大数据梦工厂支持提供以下内容,DT大数据梦工厂专注于Spark发行版定制. 内容概括: 1Exactly once 2 输出不重复 1 正如银行 ...

  3. HTML引入外部文件,解决统一管理导航栏问题。

    1.IFrame引入,看看下面的代码     <IFRAME NAME="content_frame" width=100% height=30 marginwidth=0 ...

  4. mysql TIMESTAMP 设置为可NULL字段

    今天遇到问题是mysql新建表的时候TIMESTAMP 类型的字段 默认是NOT NULL 然后上网查了一下 发现 很多都说 就是不能为NULL的 这都什么心态 其实设置为空很简单 只要在字段后面加上 ...

  5. JQuery设置时间段下拉选择 时间下拉选择

    $(document).ready(function() { var arrT = []; var tt = "{0}:{1}"; for (var i = 0; i < 2 ...

  6. asp.net mvc 模型验证注解,表单提交

    一.添加模型 public class Account { public int ID { get; set; } [Display(Name = "姓名")] //设置要显示的字 ...

  7. php 的txt操作,加入类容

    <?php $fr=fopen("./data/test.txt",'a'); //fopen(位置,打开方式) if(!$fr) { echo " error&q ...

  8. Linux编程 ---- dup函数

    dup,dup2,dup3函数       顾名思义,dup及duplicate的简写,也就是复制的意思.而事实上这几个函数的功能也确实是复制文件描述符.那为什么要复制文件描述符呢?呵呵,我认为是程序 ...

  9. C++ 之 auto_ptr and shared_ptr

    1.auto_ptr 这个所谓的只能指针有点鸡肋!  没有引用计数,而且还有一个所有权转移的情况! 当所有权转移后,以前的auto_ptr将会成为null 2.shared_ptr 增加了引用计数,没 ...

  10. jQuery深层次复制对象

    <script type="text/javascript" src="http://libs.baidu.com/jquery/1.9.1/jquery.min. ...