怎么在html,Javascript,vBscript中实现从网页上接收数据存入文本文件和从文本文件将数据显示到网页上?

时间:2022-07-16 07:31:49
怎么在html,Javascript,vBscript中实现从网页上接收数据存入文本文件和从文本文件将数据显示到网页上?请高手帮忙,注意不支持ASP,CGI,PHP等.

7 个解决方案

#1


难道大家都不会,不可能吧?

#2


编写内容页面a.js: 
m=''; 
m+='加入要写的内容1'; 
m+='加入要写的内容2'; 
m+='加入要写的内容3'; 
m+='加入要写的内容4'; 
m+='加入要写的内容5'; 
m+='加入要写的内容6'; 
m+='加入要写的内容7'; 
从文本接收数据:
----------------------------
m+='加入要写的内容8'; 
m+='加入要写的内容9'; 
document.write(m); 

设字符串变量,并赋初值,连接字符串,然后输出。 
在引用页面index.html在编写: 
<script language=javascript src=./../a.js></script> 
---------------------------
从网上接收数据存入文本我就不知道了。:)

#3


用数据绑顶也可以啊
把这个文件site.txt
"Site","Inv_type","Favorite","Name","Site_fmt","Hits:INT","Month:INT","YTD:INT","Banner","url","Info"
"Microsoft","Y","true","Microsoft Corporation","<em>Microsoft</em>","236,887","7,106,610","271,493,165","http://microsoft.com/library/toolbar/images/banner.gif","http://www.microsoft.com/","Microsoft's vision is to empower people through great software - any time, any place and on any device."
"MSDN","N","false","Microsoft Developer Network","<strong>MSDN</strong>","125,771","3,773,150","137,231,063","http://msdn.microsoft.com/msdn-online/shared/graphics/banners/home-banner.gif","http://msdn.microsoft.com","MSDN, the Microsoft Developer Network, is the essential resource for developers. MSDN developer programs make it easy to find timely, comprehensive development resources, including software subscription programs, technical information, Web sites, and conferences."
"MSN","N","true","Microsoft Network (MSN)","<s>MSN</s>","615,239","18,457,170","671,298,645","http://msimg.com/w/logo_bf2.gif","http://www.msn.com/","Microsoft Network - Your Guide to the Internet."
"MSNBC","Y","false","MSNBC","<font size=+2>MSNBC</font>","745,973","22,379,190","813,944,929","http://msnbc.com/i/ca.gif","http://www.msnbc.com/news/default.asp","The #1 Internet News Site!"

#4



<SCRIPT LANGUAGE="JavaScript">

function forward() {
  if (SiteList.recordset.AbsolutePosition != SiteList.recordset.RecordCount) {
SiteList.recordset.MoveNext();
}
else {
alert("Already at last element");
}
}

function reverse() {
 

  if (SiteList.recordset.AbsolutePosition != 1) {
SiteList.recordset.MovePrevious();
}
else {
alert("Already at first element");
}
}

</SCRIPT>


</HEAD>






<OBJECT ID="SiteList" CLASSID="clsid:333C7BC4-460F-11D0-BC04-0080C7055A83" WIDTH=0 HEIGHT=0>
  <PARAM NAME="UseHeader" VALUE="True">
  <PARAM NAME="TextQualifier" VALUE="&quot;">
  <PARAM NAME="FieldDelim" VALUE=",">
  <PARAM NAME="DataURL" VALUE="site.txt">
</OBJECT>

<CENTER>
<A DATASRC="#SiteList" DATAFLD="url" TARGET="_top"><SPAN DATASRC="#SiteList" DATAFLD="url"></SPAN></A>
<HR width=100>
<INPUT TYPE="button" VALUE="  <  " onClick="reverse();">
<INPUT TYPE="button" VALUE="  >  " onClick="forward();">
<HR width=100>
<P>
</CENTER>

#5


通过这样的方法可以得到一个相当于vb的数据绑顶
不过是通过active空间
这是从mircosost那找到的例子
由于比较懒就不写修改文本文件的部分了

#6


我得好好看看书了,不好意思。

#7


谁有高招,请使出呀!

#1


难道大家都不会,不可能吧?

#2


编写内容页面a.js: 
m=''; 
m+='加入要写的内容1'; 
m+='加入要写的内容2'; 
m+='加入要写的内容3'; 
m+='加入要写的内容4'; 
m+='加入要写的内容5'; 
m+='加入要写的内容6'; 
m+='加入要写的内容7'; 
从文本接收数据:
----------------------------
m+='加入要写的内容8'; 
m+='加入要写的内容9'; 
document.write(m); 

设字符串变量,并赋初值,连接字符串,然后输出。 
在引用页面index.html在编写: 
<script language=javascript src=./../a.js></script> 
---------------------------
从网上接收数据存入文本我就不知道了。:)

#3


用数据绑顶也可以啊
把这个文件site.txt
"Site","Inv_type","Favorite","Name","Site_fmt","Hits:INT","Month:INT","YTD:INT","Banner","url","Info"
"Microsoft","Y","true","Microsoft Corporation","<em>Microsoft</em>","236,887","7,106,610","271,493,165","http://microsoft.com/library/toolbar/images/banner.gif","http://www.microsoft.com/","Microsoft's vision is to empower people through great software - any time, any place and on any device."
"MSDN","N","false","Microsoft Developer Network","<strong>MSDN</strong>","125,771","3,773,150","137,231,063","http://msdn.microsoft.com/msdn-online/shared/graphics/banners/home-banner.gif","http://msdn.microsoft.com","MSDN, the Microsoft Developer Network, is the essential resource for developers. MSDN developer programs make it easy to find timely, comprehensive development resources, including software subscription programs, technical information, Web sites, and conferences."
"MSN","N","true","Microsoft Network (MSN)","<s>MSN</s>","615,239","18,457,170","671,298,645","http://msimg.com/w/logo_bf2.gif","http://www.msn.com/","Microsoft Network - Your Guide to the Internet."
"MSNBC","Y","false","MSNBC","<font size=+2>MSNBC</font>","745,973","22,379,190","813,944,929","http://msnbc.com/i/ca.gif","http://www.msnbc.com/news/default.asp","The #1 Internet News Site!"

#4



<SCRIPT LANGUAGE="JavaScript">

function forward() {
  if (SiteList.recordset.AbsolutePosition != SiteList.recordset.RecordCount) {
SiteList.recordset.MoveNext();
}
else {
alert("Already at last element");
}
}

function reverse() {
 

  if (SiteList.recordset.AbsolutePosition != 1) {
SiteList.recordset.MovePrevious();
}
else {
alert("Already at first element");
}
}

</SCRIPT>


</HEAD>






<OBJECT ID="SiteList" CLASSID="clsid:333C7BC4-460F-11D0-BC04-0080C7055A83" WIDTH=0 HEIGHT=0>
  <PARAM NAME="UseHeader" VALUE="True">
  <PARAM NAME="TextQualifier" VALUE="&quot;">
  <PARAM NAME="FieldDelim" VALUE=",">
  <PARAM NAME="DataURL" VALUE="site.txt">
</OBJECT>

<CENTER>
<A DATASRC="#SiteList" DATAFLD="url" TARGET="_top"><SPAN DATASRC="#SiteList" DATAFLD="url"></SPAN></A>
<HR width=100>
<INPUT TYPE="button" VALUE="  <  " onClick="reverse();">
<INPUT TYPE="button" VALUE="  >  " onClick="forward();">
<HR width=100>
<P>
</CENTER>

#5


通过这样的方法可以得到一个相当于vb的数据绑顶
不过是通过active空间
这是从mircosost那找到的例子
由于比较懒就不写修改文本文件的部分了

#6


我得好好看看书了,不好意思。

#7


谁有高招,请使出呀!