<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<html>
<head>
<title>My JSP 'shop_cart.jsp' starting page</title>
<script type="text/javascript" src="Jquery/jquery-1.7.2.js"></script>
<script type="text/javascript">
$(function(){
var isHasCart = "${sessionScope.sc == null}";
if(isHasCart == "true"){
$("#mes").hide();
}else{
$("#mes").show();
$("#bookname").text("${sessionScope.sc.bookname}");
$("#totalNumber").text("${sessionScope.sc.totalNumber}");
$("#totalMoney").text("${sessionScope.sc.totalMoney}");
}
$("a:first").click(function(){
$("#mes").show();
var num1 = $("input[name='num']:first").val();
var num = num1;
var url = this.href+num;
var args = {"time":new Date()};
$.getJSON(url,args,function(data){
$("#bookname").text(data.bookname);
$("#totalNumber").text(data.totalNumber);
$("#totalMoney").text(data.totalMoney);
});
var num1 = $("input[name='num']:first").val("");
return false;
});
$("a:eq(1)").click(function(){
$("#mes").show();
var num2 = $("input[name='num']:eq(1)").val()
var num = num2;
var url = this.href+num;
var args = {"time":new Date()};
<html>
<head>
<title>My JSP 'shop_cart.jsp' starting page</title>
<script type="text/javascript" src="Jquery/jquery-1.7.2.js"></script>
<script type="text/javascript">
$(function(){
var isHasCart = "${sessionScope.sc == null}";
if(isHasCart == "true"){
$("#mes").hide();
}else{
$("#mes").show();
$("#bookname").text("${sessionScope.sc.bookname}");
$("#totalNumber").text("${sessionScope.sc.totalNumber}");
$("#totalMoney").text("${sessionScope.sc.totalMoney}");
}
$("a:first").click(function(){
$("#mes").show();
var num1 = $("input[name='num']:first").val();
var num = num1;
var url = this.href+num;
var args = {"time":new Date()};
$.getJSON(url,args,function(data){
$("#bookname").text(data.bookname);
$("#totalNumber").text(data.totalNumber);
$("#totalMoney").text(data.totalMoney);
});
var num1 = $("input[name='num']:first").val("");
return false;
});
$("a:eq(1)").click(function(){
$("#mes").show();
var num2 = $("input[name='num']:eq(1)").val()
var num = num2;
var url = this.href+num;
var args = {"time":new Date()};