使用HTML/JAVASCRIPT编写和读取文件

使用HTML/JAVASCRIPT编写和读取文件,javascript,html,jsp,file-io,Javascript,Html,Jsp,File Io,场景:我有两个html文件,当我在一个home.html中放置orderID时,另一个customerView.html会得到更新。另一个将在新窗口中打开 我需要帮助的地方的要求:我希望应该有一种称为order.txt的文本文件,它可以将我在home.hmtl中创建的所有条目保留在tab中,最多10个条目,并显示customerView.html中的所有条目,并且随着我不断向home.html添加新订单,order.txt应该会得到更新,并在此基础上删除文本文件中的旧条目先进先出。第二个html

场景:我有两个html文件,当我在一个home.html中放置orderID时,另一个customerView.html会得到更新。另一个将在新窗口中打开

我需要帮助的地方的要求:我希望应该有一种称为order.txt的文本文件,它可以将我在home.hmtl中创建的所有条目保留在tab中,最多10个条目,并显示customerView.html中的所有条目,并且随着我不断向home.html添加新订单,order.txt应该会得到更新,并在此基础上删除文本文件中的旧条目先进先出。第二个html文件customerView.html应显示order.txt文件中的所有条目,并在home.html中生成的任何条目上进行更新

<!DOCTYPE html>
<html>
</script>
<body bgcolor="yellow">
<h2 align="center">Welcome to OHH LA LA</h2>
<form target="page2.html" type=get action="customerView.html">
<table>
<tr>
<td>OrderID:</td>
<td colspan=200><input type=text name=orderId size=10></td>
</tr>
<tr>
<td colspan=200><input type=submit value="Submit">
</td>
</tr>
</table>
</form>
<body>
</html>
我无法实现文件处理,但已在下面编写了html文件,每当我在home.html中输入内容时,这些文件将帮助在customerView.html中显示orderID

<!DOCTYPE html>
<html>
</script>
<body bgcolor="yellow">
<h2 align="center">Welcome to OHH LA LA</h2>
<form target="page2.html" type=get action="customerView.html">
<table>
<tr>
<td>OrderID:</td>
<td colspan=200><input type=text name=orderId size=10></td>
</tr>
<tr>
<td colspan=200><input type=submit value="Submit">
</td>
</tr>
</table>
</form>
<body>
</html>

欢迎来到奥哈拉拉
医嘱ID:


欢迎来到奥哈拉拉
函数getParams(){
var idx=document.URL.indexOf(“?”);
var params=新数组();
如果(idx!=-1){
var pairs=document.URL.substring(idx+1,document.URL.length).split('&');

对于(var i=0;i您需要设置cookie您可以再详细说明一下转到google并键入“如何使用编程语言x设置cookie”,其中x是您的应用程序服务器使用的语言可能重复: