how2j.cn


步骤 1 :

效果

注:这里的原型是展示效果,让大家有个感性的认识,编码不在这里进行,项目开发过程会在后面的章节从零开始。
"); window.frames["iframe_show3664"].document.write(decodeHtml($("textarea#stepcodeTextarea3664").val())); window.frames["iframe_show3664"].document.close(); $(window.frames["iframe_show3664"]).load(function(){ $("#iframe_show3664").height($("#iframe_show3664").contents().find("body").height()+showittryitheight); }); $("#iframe_show3664").height($("#iframe_show3664").contents().find("body").height()+showittryitheight); setTimeout(function(){ },500); });
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <html> <head> <script src="http://127.0.0.1/study../../../js/jquery/2.0.0/jquery.min.js"></script> <link href="http://127.0.0.1/study../../../css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet"> <script src="http://127.0.0.1/study../../../js/bootstrap/3.3.6/bootstrap.min.js"></script> <link href="http://127.0.0.1/tmall../../../css/back/style.css" rel="stylesheet"> <script> function checkEmpty(id, name){ var value = $("#"+id).val(); if(value.length==0){ alert(name+ "不能为空"); $("#"+id)[0].focus(); return false; } return true; } function checkNumber(id, name){ var value = $("#"+id).val(); if(value.length==0){ alert(name+ "不能为空"); $("#"+id)[0].focus(); return false; } if(isNaN(value)){ alert(name+ "必须是数字"); $("#"+id)[0].focus(); return false; } return true; } function checkInt(id, name){ var value = $("#"+id).val(); if(value.length==0){ alert(name+ "不能为空"); $("#"+id)[0].focus(); return false; } if(parseInt(value)!=value){ alert(name+ "必须是整数"); $("#"+id)[0].focus(); return false; } return true; } $(function(){ $("a").click(function(){ var deleteLink = $(this).attr("deleteLink"); console.log(deleteLink); if("true"==deleteLink){ var confirmDelete = confirm("确认要删除"); if(confirmDelete) return true; return false; } }); }) </script> </head> <body> <div class="navitagorDiv"> <nav class="navbar navbar-default navbar-fixed-top navbar-inverse"> <img style="margin-left:10px;margin-right:0px" class="pull-left" src="http://127.0.0.1/tmall../../../img/site/tmallbuy.png" height="45px"> <a class="navbar-brand" href="#nowhere">天猫后台</a> <a class="navbar-brand" href="#nowhere">分类管理</a> <a class="navbar-brand" href="#nowhere">用户管理</a> <a class="navbar-brand" href="#nowhere">订单管理</a> </nav> </div> <script> $(function() { $("#addForm").submit(function() { if (checkEmpty("name", "属性名称")) return true; return false; }); }); </script> <title>属性管理</title> <div class="workingArea"> <ol class="breadcrumb"> <li><a href="#nowhere">所有分类</a></li> <li><a href="#nowhere">平板电视</a></li> <li class="active">属性管理</li> </ol> <div class="listDataTableDiv"> <table class="table table-striped table-bordered table-hover table-condensed"> <thead> <tr class="success"> <th>ID</th> <th>属性名称</th> <th>编辑</th> <th>删除</th> </tr> </thead> <tbody> <tr> <td>13</td> <td>操作系统</td> <td><a href="#nowhere"><span class="glyphicon glyphicon-edit"></span></a></td> <td><a deleteLink="true" href="#nowhere"><span class=" glyphicon glyphicon-trash"></span></a></td> </tr> <tr> <td>12</td> <td>3D类型</td> <td><a href="#nowhere"><span class="glyphicon glyphicon-edit"></span></a></td> <td><a deleteLink="true" href="#nowhere"><span class=" glyphicon glyphicon-trash"></span></a></td> </tr> <tr> <td>11</td> <td>能效等级</td> <td><a href="#nowhere"><span class="glyphicon glyphicon-edit"></span></a></td> <td><a deleteLink="true" href="#nowhere"><span class=" glyphicon glyphicon-trash"></span></a></td> </tr> <tr> <td>10</td> <td>产品名称</td> <td><a href="#nowhere"><span class="glyphicon glyphicon-edit"></span></a></td> <td><a deleteLink="true" href="#nowhere"><span class=" glyphicon glyphicon-trash"></span></a></td> </tr> <tr> <td>9</td> <td>网络连接方式</td> <td><a href="#nowhere"><span class="glyphicon glyphicon-edit"></span></a></td> <td><a deleteLink="true" href="#nowhere"><span class=" glyphicon glyphicon-trash"></span></a></td> </tr> </tbody> </table> </div> <div class="pageDiv"> <script> $(function(){ $("ul.pagination li.disabled a").click(function(){ return false; }); }); </script> <nav> <ul class="pagination"> <li class="disabled"> <a href="#nowhere" aria-label="Previous" > <span aria-hidden="true">«</span> </a> </li> <li class="disabled"> <a href="#nowhere" aria-label="Previous" > <span aria-hidden="true">‹</span> </a> </li> <li class="disabled"> <a href="#nowhere" class="current" >1</a> </li> <li > <a href="#nowhere" >2</a> </li> <li > <a href="#nowhere" >3</a> </li> <li > <a href="#nowhere" aria-label="Next"> <span aria-hidden="true">›</span> </a> </li> <li > <a href="#nowhere" aria-label="Next"> <span aria-hidden="true">»</span> </a> </li> </ul> </nav> </div> <div class="panel panel-warning addDiv"> <div class="panel-heading">新增属性</div> <div class="panel-body"> <form method="post" id="addForm" > <table class="addTable"> <tr> <td>属性名称</td> <td><input id="name" name="name" type="text" class="form-control"></td> </tr> <tr class="submitTR"> <td colspan="2" align="center"> <input type="hidden" name="cid" value="83"> <button type="button" class="btn btn-success">提 交</button> </td> </tr> </table> </form> </div> </div> </div> <div class="footer"> </div> </body> </html>
"); window.frames["iframe3664"].document.write(decodeHtml(code3664)); window.frames["iframe3664"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe3664"]).load(function(){ $("#iframe3664").height($("#iframe3664").contents().find("body").height()+showittryitheight); }); $("#iframe3664").height($("#iframe3664").contents().find("body").height()+showittryitheight); alreadyWriteCode3664 = code3664; $("#rendering3664").hide(); $("#rendered3664").show(); } var tRereshRetry2DemoPanel3664 = setInterval(rereshRetry2DemoPanel3664,1000); var binded3664 = false; $("textarea#stepcodeTextarea3664").keyup(function(){ if(!binded3664){ $(window).bind('beforeunload',function(){ binded3664 = true; return "xxxx"; }); } var newCode = $(this).val() code3664 = newCode; /*below code is replaced by function rereshRetry2DemoPanel()*/ // if(code3664!=newCode){ // window.frames["iframe3664"].document.write("
"); // window.frames["iframe3664"].document.write(decodeHtml($("textarea#stepcodeTextarea3664").val())); // window.frames["iframe3664"].document.close(); // $(window.frames["iframe3664"]).load(function(){ // $("#iframe3664").height($("#iframe3664").contents().find("body").height()+showittryitheight); // }); // code3664 = newCode; // } }); $(".tryButton3664").click(function(){ $("#tryDiv3664").show(); $("#stepcodeTextarea3664").focus(); $("#stepcodeTextarea3664").height(200); $("#iframe3664").height(0); window.frames["iframe3664"].document.write("
"); window.frames["iframe3664"].document.write(decodeHtml($("textarea#stepcodeTextarea3664").val())); window.frames["iframe3664"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe3664"]).load(function(){ $("#iframe3664").height($("#iframe3664").contents().find("body").height()+showittryitheight); }); $("#iframe3664").height($("#iframe3664").contents().find("body").height()+showittryitheight); this.scrollIntoView(true); editor3664.focus(); editor3664.setSize(null, "250"); $("#rendering3664").hide(); $("#rendered3664").hide(); }); var mixedMode = { name: "htmlmixed", scriptTypes: [{matches: /\/x-handlebars-template|\/x-mustache/i, mode: null}, {matches: /(text|application)\/(x-)?vb(a|script)/i, mode: "vbscript"}] }; var editor3664 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea3664"), { lineNumbers: true, styleActiveLine: true, matchBrackets: true, mode:"text/html", theme:"eclipse", selectionPointer: true, lineWrapping: true, extraKeys: { "Alt-/": "autocomplete", "Ctrl-F": "findPersistent", "F8": function(cm) { cm.setOption("fullScreen", !cm.getOption("fullScreen")); }, "Esc": function(cm) { if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false); } } }); editor3664.on("change",function(doc){ if(!binded3664){ $(window).bind('beforeunload',function(){ binded3664 = true; return "xxxx"; }); } var newCode = doc.getValue(); code3664 = newCode; $("textarea#stepcodeTextarea3664").val(newCode); if(alreadyWriteCode3664!=code3664){ lastModifedTime3664 = new Date().getTime(); $("#rendering3664").show(); $("#rendered3664").hide(); } // alert(doc.getValue()); }); $(".CodeMirror").addClass("form-control"); // var editor3664 = CodeMirror.fromTextArea(, { // lineNumbers: true, // styleActiveLine: true, // matchBrackets: true, // theme:"eclipse", // }); editor3664.on("change",function(doc){ // alert(doc.getValue()); }); $("#tryDiv3664").hide(); }); $("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");


源代码
1. 双击选中单词 2. 三击选中整行 3. CTRL+F 查找 4. F8 全屏编辑,再次点击恢复
渲染中 渲染完成
效果


HOW2J公众号,关注后实时获知布最新的教程和优惠活动,谢谢。


关于 实践项目-天猫整站J2EE-属性管理 的提问

尽量提供截图代码异常信息,有助于分析和解决问题。 也可进本站QQ群交流: 620943819
提问尽量提供完整的代码,环境描述,越是有利于问题的重现,您的问题越能更快得到解答。
对教程中代码有疑问,请提供是哪个步骤,哪一行有疑问,这样便于快速定位问题,提高问题得到解答的速度
在已经存在的几千个提问里,有相当大的比例,是因为使用了和站长不同版本的开发环境导致的,比如 jdk, eclpise, idea, mysql,tomcat 等等软件的版本不一致。
请使用和站长一样的版本,可以节约自己大量的学习时间。 站长把教学中用的软件版本整理了,都统一放在了这里, 方便大家下载: http://how2j.cn/k/helloworld/helloworld-version/1718.html

上传截图