如何生成一个js,通过这个js可以调用,数据表中前10条记录。

混世罗汉 2008-07-17 08:18:55
大哥们, 我已经做好了一个程序,就是取一个数据表的前10条记录,已经用vs.net2005做好了。但要集成在一个门户网站上,对方说让我把这个页面或功能做成一个js,供他们调用。晕啊,什么意思啊。 不懂什么叫做成js供调用。 我一直是用iframe供别人调用的。

求教了,谢谢
...全文
233 17 打赏 收藏 转发到动态 举报
写回复
用AI写文章
17 条回复
切换为时间正序
请发表友善的回复…
发表回复
混世罗汉 2008-07-19
  • 打赏
  • 举报
回复
请做过的朋友给个源码案例
strife013 2008-07-18
  • 打赏
  • 举报
回复
ajax,做完了贴出代码来看看哦
lixueming3000 2008-07-18
  • 打赏
  • 举报
回复
你可以把得到的数据通过js拼成html页面,用户调的时候只要给一个路径就行了,就会在用户的网站上的那一块显来出来数据了

也可以通过ajax做,这就看个人的习惯了
混世罗汉 2008-07-18
  • 打赏
  • 举报
回复
最后一顶
amanizty 2008-07-17
  • 打赏
  • 举报
回复
学习下~
yagebu1983 2008-07-17
  • 打赏
  • 举报
回复
学习一下!!
mengjun5200 2008-07-17
  • 打赏
  • 举报
回复
现在的客户要求怎么这么专业?
混世罗汉 2008-07-17
  • 打赏
  • 举报
回复
顶了,这么麻烦啊
JeffChung 2008-07-17
  • 打赏
  • 举报
回复
ajax异步调用webservice
verydeed 2008-07-17
  • 打赏
  • 举报
回复
看了楼主的问题,有以下两种方法:

1. 使用ajax
2. 使用iframe

以上2个的大的方向

bolome 2008-07-17
  • 打赏
  • 举报
回复
关注,也想了解。
ufostop 2008-07-17
  • 打赏
  • 举报
回复
用XMLHttpRequest对象异步调用页面,返回xml,用Js输出在页面中!
fellowcheng 2008-07-17
  • 打赏
  • 举报
回复
动物园
ming4089 2008-07-17
  • 打赏
  • 举报
回复
up
MisterDotNet 2008-07-17
  • 打赏
  • 举报
回复
做成js 这个就不清楚了,
con=DB.ReturnConn();
title=Int32.Parse(Request.QueryString["t"].ToString());
voteoptin=DB.CR(title,con);
voteoptin=voteoptin.Replace("\"","'");

titleName= DB.voteTitle(title,con);
titleCount= DB.titleCount(title,con);

Response.Write("document.write(\"<form id=Form1 action=voteMain.aspx>\");");
Response.Write("document.write(\"<div align=left>\");");
Response.Write("document.write(\"<table border=0 cellspacing=1 cellpadding=3 bgcolor=#ffffff>\");");
Response.Write("document.write(\"<tr>\");");
Response.Write("document.write(\"<td nowrap><b>"+titleName+"</b></td>\");");
Response.Write("document.write(\"</tr>\");");

Response.Write("document.write(\"<tr>\");");
Response.Write("document.write(\"<td nowrap>"+voteoptin+"</td>\");");
Response.Write("document.write(\"</tr>\");");

Response.Write("document.write(\"<tr>\");");
Response.Write("document.write(\"<td nowrap><input type=submit value=投上一票 BackColor=White></td>\");");
Response.Write("document.write(\"</tr>\");");

Response.Write("document.write(\"<tr>\");");
Response.Write("document.write(\"<td nowrap><A onclick=javascript:window.open('result.aspx?t="+title+"','','width=402,height=200,top=300,left=350,resizable=yes,scrollbars=no,status=no,toolbar=no,menubar=no,location=no'); href=# >查看结果</A></td>\");");
Response.Write("document.write(\"</tr>\");");

Response.Write("document.write(\"<tr>\");");
Response.Write("document.write(\"<td nowrap>共有<font color=#ff0000>"+titleCount+"</font>人参加</td>\");");
Response.Write("document.write(\"</tr>\");");


Response.Write("document.write(\"<input type=hidden value="+Request["t"]+" name=t id=t>\");");
Response.Write("document.write(\"<input type=hidden value="+Request["s"]+" name=s id=s>\");");


Response.Write("document.write(\"</table>\");");
Response.Write("document.write(\"</div>\");");
Response.Write("document.write(\"</form>\");");


给楼主这个例子看一下,希望可以有所帮助,调用的时候也是 使用 <script src=> 调用
sskeyial 2008-07-17
  • 打赏
  • 举报
回复
http://topic.csdn.net/u/20080715/11/6e3b887f-b689-49cd-b4b5-6f7211281fae.html
shoushii 2008-07-17
  • 打赏
  • 举报
回复
一个JS方法,异步访问数据库,返回JSON

61,817

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧