书签 分享 收藏 举报 版权申诉 / 46

类型web实验报告.docx

  • 文档编号:9855915
  • 上传时间:2023-02-07
  • 格式:DOCX
  • 页数:46
  • 大小:194.09KB

用户名

密码

确认密码

varvPsw=document.getElementById("password");

varvPsw2=document.getElementById("password2");

varp1=vPsw.value;

varp2=vPsw2.value;

functionregist(){

varusername=$("#username").val();

varpwd=$("#password").val();

varpwd2=$("#password2").val();

//alert("pwd"+pwd);

//alert("pwd2"+pwd2);

if(username==""||pwd==""){

alert("用户名或密码不能为空");

}elseif(pwd!

=pwd2){

alert("两次密码输入不一致");

}else{

vardataJson={"username":

username,"password":

pwd};

//alert(username+pwd);

$.ajax({

url:

"regist",

data:

dataJson,

type:

"post",

dataType:

"json",

success:

function(data){

//alert(data);

//alert(data);

varflag=data.flag;

//alert(flag);

if(flag=="-1"){

alert("用户名已经存在");

}elseif(flag=='1'){

alert("注册成功");

}

}

});

}

}

登录:

<%@pagelanguage="java"contentType="text/html;charset=UTF-8"

pageEncoding="UTF-8"%>

DOCTYPEhtml>

Inserttitlehere

 

--action代表了服务器端的处理程序-->

---->

<%

Stringflag=request.getParameter("flag");

System.out.println("flag"+flag);

if("out".equals(flag)){

session.setAttribute("username",null);

System.out.println("flag"+flag);

}

%>

登录注册

用户名

密码

登录

functionlogin(){

varusername=$("#account").val();

varpwd=$("#password").val();

vardataJson={"username":

username,"password":

pwd};

//alert("pwd"+pwd);

$.ajax({

url:

"login",

data:

dataJson,

type:

"post",

dataType:

"json",

success:

function(data){

//alert(data);

//alert(data);

varflag=data.flag;

//alert(flag);

if(flag=="-1"){

alert("用户名不存在");

}elseif(flag=='0'){

window.location.href="control.jsp?

username="+username;

}else{

alert("密码错误");

}

}

});

}

 

购物车:

<%@pagelanguage="java"contentType="text/html;charset=UTF-8"

pageEncoding="UTF-8"%>

<%@tagliburi="prefix="c"%>

<%@taglibprefix="fmt"uri="%>

DOCTYPEhtml>

Inserttitlehere

返回继续购物

  • 全选
  • 商品名称

    总价

    单价

    数量

    操作

    forEachitems="${cartList}"var="cart">

  • ${cart.name}-${cart.id}

    formatNumbervalue="${cart.totalPrice}"type="currency"/>

    formatNumbervalue="${cart.price}"type="currency"/>

    productId=${cart.productId}">-

    productId=${cart.productId}">+

    productId=${cart.id}">删除

    forEach>

    --

    forEachvar="cart"items="${cartList}">


    ${cart.name}

    ${cart.price}元

    ${cart.count}份

    forEach>

    -->

    电商主页:

    <%@pageimport="java.util.List"%>

    <%@pagelanguage="java"contentType="text/html;charset=UTF-8"

    pageEncoding="UTF-8"%>

    <%@tagliburi="prefix="c"%>

    <%@taglibprefix="fmt"uri="%>

    DOCTYPEhtml>

    每日生鲜,天天放心

    varvTimer=setInterval(function(){

    vartitle=document.title;

    varbegin=title.substr(0,1);

    varend=title.substr(1,title.length);

    document.title=end+begin;

    },1000)

    *{

    font-family:

    微软雅黑;

    }

    ulli{

    text-decoration:

    none;

    }

    .list-content{

    width:

    1200px;

    height:

    300px;

    }

    .list-contentulliimg{

    width:

    120px;

    height:

    144px;

    }

    .list-contentulli{

    width:

    248px;

    height:

    298px;

    text-align:

    center;

    list-style:

    none;

    border:

    1pxsolid#ededed;

    float:

    left;

    }

    .list-contentulli:

    hover{

    opacity:

    0.7;

    }

    .list-contentullih3{

    color:

    #43A200;

    }

    .list-contentullih4{

    margin-top:

    5px;

    }

    .desc{

    color:

    silver;

    }

    .shopcart{

    //position:

    relative;

    margin-top:

    -5px;

    }

    <%

    Stringusername=request.getParameter("username");

    if(username==null){

    username=(String)session.getAttribute("username");

    }

    session.setAttribute("username",username);

    %>

    欢迎

    iftest="${username!

    =null}">

    <%=username%>

    if>

    来到¥19.9生鲜商城

    我的购物车

    全部商品分类

  • 首页     |
  • 速冻食品     |
  • 禽类蛋品     |
  • 新鲜水果     |
  • 猪牛羊肉     |
  • 新鲜蔬菜     |
  • 海鲜水产     
  • 举报
    举报
    版权申诉
    版权申诉
    word格式文档无特别注明外均可编辑修改;预览文档经过压缩,下载后原文更清晰! 立即下载
    配套讲稿:

    如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。

    特殊限制:

    部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。

    关 键  词:
    web 实验 报告
    提示  冰豆网所有资源均是用户自行上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作他用。
    关于本文
    本文标题:web实验报告.docx
    链接地址:https://www.bdocx.com/doc/9855915.html
    相关搜索
    关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

    copyright@ 2008-2022 冰点文档网站版权所有

    经营许可证编号:鄂ICP备2022015515号-1

    收起
    展开