代码改变世界

加入收藏夹 js 兼容Firefox 和 IE (转)

2009-09-15 14:37 by AkingShoot, 965 阅读, 0 推荐, 收藏, 编辑
摘要:收藏代码:兼容Firefox(火狐)浏览器和IE浏览器的收藏代码2009-06-18 11:18 最近改用Firefox后,发现很多网站的“加入收藏”链接点击无效了,后来发现原来是IE浏览器和Firefox浏览器的“加入收藏夹”的写法是不同的。 1、IE浏览器加入收藏夹的代码   window.external.addFavorite(sURL, s... 阅读全文

js中cookie的使用

2009-07-28 17:52 by AkingShoot, 200 阅读, 0 推荐, 收藏, 编辑
摘要://创建一个Cookiefunction writeCookie(){ var destoryTime = new Date(); destoryTime.setTime(destoryTime.getTime()+24*3600*1000); var expireTime = destoryTime.toGMTString(); document.cookie = "vistited=tru... 阅读全文

关于Ajax(优势)

2009-07-28 17:49 by AkingShoot, 695 阅读, 0 推荐, 收藏, 编辑
摘要:Ajax应用程序的优势在于:1. 通过异步模式,提升了用户体验2. 优化了浏览器和服务器之间的传输,减少不必要的数据往返,减少了带宽占用3. Ajax引擎在客户端运行,承担了一部分本来由服务器承担的工作,从而减少了大用户量下的服务器负载。ajax原理ajax AJAX全称为“Asynchronous JavaScript and XML”(异步JavaScript和XML)... 阅读全文

关于MD5加密

2009-07-28 17:43 by AkingShoot, 182 阅读, 0 推荐, 收藏, 编辑
摘要:引用命名空间using System.Web.Security; //MD5加密后长度是32位 FormsAuthentication.HashPasswordForStoringInConfigFile("abc","md5") //SH1加密后长度是40位 FormsAuthentication.HashPasswordForStoringInConfigFile("abc", "sha1")... 阅读全文

ajax 中 readystate 的五种状态!

2009-07-02 10:39 by AkingShoot, 244 阅读, 0 推荐, 收藏, 编辑
摘要:function q(url,id) { var xmlhttp = null; var url = url + "?name=" + document.getElementById("div").innerText; if (window.XMLHttpRequest) { xmlhttp = new XMLHttpRequest(); } else if (window.ActiveXObje... 阅读全文

setTimeout 与 setInterval 的区别

2009-06-30 09:27 by AkingShoot, 190 阅读, 0 推荐, 收藏, 编辑
摘要:可能有些人对js 中的 setTimeout 和 setInterval 的区别弄不清 先在我们来写一段程序区分一下两者: function showTime(){var today = new Date();alert("today is "+today.toString());}//setTimeout("showTime",1000); setInterval("showTime",1000... 阅读全文

分页存储过程(摘抄)

2009-06-27 17:03 by AkingShoot, 225 阅读, 0 推荐, 收藏, 编辑
摘要:**//**//*说明:1.支持多表查询2.支持任意排序3.不支持表别名参考了evafly920:[分享]千万数量级分页存储过程(效果演示)地址:http://blog.csdn.net/evafly920/archive/2006/03/03/614813.aspxIF(EXISTS(SELECT*FROMsysobjectsWHERE[id]=OBJECT_ID('usp_PagingLarg... 阅读全文

ajax 调用后台的方法

2009-06-27 15:30 by AkingShoot, 371 阅读, 0 推荐, 收藏, 编辑
摘要://前台的代码 <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods=true> </asp:ScriptManager> <script> ( function scriptgetdate() { PageMethods.getdate(onsuccess);//通过Pa... 阅读全文

如何通过ajax调用webservice重载的方法

2009-06-27 15:21 by AkingShoot, 343 阅读, 0 推荐, 收藏, 编辑
摘要://建立一个页面 用一个scriptManager <asp:ScriptManager ID="ScriptManager1" runat="server" ScriptMode=Debug> </asp:ScriptManager> <script> function invorkwebservice() { var name = 'king';//参数 S... 阅读全文

随机从数据库中取出10记录

2009-06-27 14:38 by AkingShoot, 133 阅读, 0 推荐, 收藏, 编辑
摘要:select top 10 from 表名 order by newid() 阅读全文