Home >Database >Mysql Tutorial >mysql-Java入门新人求解答:如何能保存修改后的网页?求代码

mysql-Java入门新人求解答:如何能保存修改后的网页?求代码

WBOY
WBOYOriginal
2016-06-06 09:33:371168browse

mysqljavascriptjavamyeclipse

pageEncoding="utf-8"%>

String path = request.getContextPath();

String basePath = request.getScheme() + "://"

+ request.getServerName() + ":" + request.getServerPort()

+ path + "/";

%>





Welcome to TV_Play's Web // 新增 function trdadd(){ flag=false; document.getElementById("fid").style.display="block"; //控制显示 chongzhi(); document.getElementById("aid").disabled=false; //重新启用 } //保存 function baocun(){ if(flag==false){ add(flag); document.getElementById("fid").style.display="none"; }else{ add(flag); document.getElementById("fid").style.display="none"; } } //重置 function chongzhi(){ document.getElementById("formid").reset(); } //删除 function deleteRow(input){ var s=input.parentNode.parentNode.rowIndex; document.getElementById("tableid").deleteRow(s); var num=document.getElementById("tableid").rows.length; for(var i=1;i



id name language country_of_origin genre operation
<code>  <br>    <br>    <br>    <div id="fid" style="display : none">    <form id="formid">   <table id="aaid">   <tr>    <td colspan="6">name : <input id="aid" type="text" size="20%"> </td>    <td colspan="6">language : <input id="bid" type="text" size="20%"> </td> </tr>   <tr>    <td colspan="6">country_of_origin : <input id="cid" type="text" size="20%">
</td>    <td>genre :     <select id="eid" name="my_name">        <option value="1">Horror</option>       <option value="2">Sitcom</option>        <option value="3">Fantasy</option>        <option value="4">Science Fantasy</option>        <option value="5">Crime Drama</option>      <option value="6">Period Drama</option>      <option value="7">Family</option>   </select>   </td>   </tr>   </table>      <input type="button" value="save" onclick="baocun()">      <input type="reset" value="reset" onclick="chongzhi()"> <!-- 重置type类型必须为reset-->  <!-- 重置 -->
</form>     </div>    <script type="text/javascript">     //全局变量     var table=document.getElementById("tableid");     var flag=false;     var getselectrow;     function getNum(){          var haoRow=table.rows[0];          return haoRow.cells.length;     }     //添加方法     function add(flag){        if(!flag){       // var num=getNum();        var row=table.insertRow(-1); //为-1时往下加(升序),为0时往上加(id降序)        var add1=row.insertCell(0);        var add2=row.insertCell(1);        var add3=row.insertCell(2);        var add4=row.insertCell(3);        var add5=row.insertCell(4);        var add6=row.insertCell(5);       add1.innerHTML=document.getElementById("tableid").rows.length-1;//不加-1时id从二开始;原因:标题占一个       add2.innerHTML=document.getElementById("aid").value;       add3.innerHTML=document.getElementById("bid").value;       add4.innerHTML=document.getElementById("cid").value;       var tall=document.getElementById("eid");       var   index=tall.selectedIndex;// 当前坐标       var option=tall.options[index];       add5.innerHTML=option.text;       add6.innerHTML="<input type='button' value='revise' onclick='updateRow(this)'> <input type='button' value='delete' onclick='deleteRow(this)'>";       //alert(num);       alert("Add Successfully!!");   //添加成功     }else{          var row2=table.rows[getselectrow];//选中当前行                 //把修改后的值设置到对应的文本框中          row2.cells[1].innerHTML=document.getElementById("aid").value;          row2.cells[2].innerHTML=document.getElementById("bid").value;          row2.cells[3].innerHTML=document.getElementById("cid").value;          var pall=document.getElementById("eid");          var index=pall.selectedIndex; //当前坐标          var option=pall.options[index];          row2.cells[4].innerHTML=option.text;          alert("Revise Successfully!!");   //修改成功     }      }        //修改       function updateRow(input){       flag=true       document.getElementById("aid").disabled=true;   //不能启用       document.getElementById("fid").style.display="block";       var i=input.parentNode.parentNode.rowIndex;          getselectrow=i;             //得到选中行的内容放到文本框       document.getElementById("aid").value=table.rows[i].cells[1].innerHTML;       document.getElementById("bid").value=table.rows[i].cells[2].innerHTML;       document.getElementById("cid").value=table.rows[i].cells[3].innerHTML;        var select=document.getElementById("eid");          var index=select.selectedIndex;// 当前坐标          var option= select.options[index];          option.text=table.rows[i].cells[4].innerHTML;      }  </script>  </code>



以上是我的代码,请问还有写什么代码才能让这个网站具有修改后保存的功能?
举个例子:
我添加一个id为1,name为Doctor Who,language为English,country_of_origin,
genre为Sicence_Fantasy的列,请问添加后如何让它永久保留在网页上,而不是下次刷新后就消失了?
求代码,谢谢。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn