随笔分类 -  Javascript 应用实例

摘要:该错误只在IE中出现,出现该提示的原因主要有两种:1. 重定义了系统的触发事件名称作为自定义函数名如: onclick / onsubmit ... 都是系统保留的事件名称,不允许作为重定义函数名称。2. 出现死循环,都提示:Stack overflow at line: 0 , 如:在图片对象定义了 onerror 事件的循环处理、<img src="/images/a.gif" oner... 阅读全文
posted @ 2009-01-18 12:06 Samgle 阅读(11431) 评论(4) 推荐(0) 编辑
摘要:This week I’ve been working on a project that required data to be shown visually. I needed a Chart Script that was attractive yet gets the data across. The Charts scripts below are built using JavaScript, Flash, Silverlight, and Java. Flot - Flot is a pure Javascript plotting library for jQuery. The focus is on easy usage , attractive plots and interactive features. With Flot you can interact with the data, look at specific data by zooming in, plot a time series, and other various options. 阅读全文
posted @ 2009-01-02 19:09 Samgle 阅读(1614) 评论(0) 推荐(0) 编辑
摘要: 您只需要定位经纬度就可以轻易实现 Google Maps, 让您在轻松的C#环境中非常简便地实现基于 javascript 的地图, 您不用去查找 google 大量的地图文档便可轻松完成复杂的地图功能, 当然您同样可以在当前生成的基础上进行扩展, 实现更加个性化的地图!对 Google Maps API 全面集成! 生成一张地图, 就是这么简单! 阅读全文
posted @ 2008-09-09 09:29 Samgle 阅读(7024) 评论(46) 推荐(0) 编辑
摘要: 其实园子已经存在不少基于jQuery的验证插件, 如: http://www.cnblogs.com/wzmaodong/archive/2008/05/21/1203962.html 但感觉使用起来过于麻烦, 要实现在大堆表单的验证, javascript 代码一大堆. 所以这里的设计原则就是使用便捷, 易维护, 同时适应性大. 在验证中使用了自定义正则表达式, 这样用起来就非常方便了. 先看下最后的效果图 阅读全文
posted @ 2008-08-07 00:09 Samgle 阅读(21493) 评论(64) 推荐(1) 编辑
摘要:http://lab.berkerpeksag.com/jGrowWhat is jGrow?jGrow is a jQuery plug-in that makes the textarea adjust its size according to the length of the text.It works smoothly with jQuery 1.2.x. It was tested ... 阅读全文
posted @ 2008-07-24 21:57 Samgle 阅读(1536) 评论(1) 推荐(0) 编辑
摘要://函数名:strByteLength //功能介绍:返回字符串的字节长度 //参数说明:str 要检查的字符串//返回值:字符串长度function strByteLength(str) { var i,sum; sum=0; for(i=0;i=0) && (str.charCodeAt(i)=0) && (strTemp.charCodeAt(i)=0){ ... 阅读全文
posted @ 2008-07-18 13:02 Samgle 阅读(1043) 评论(0) 推荐(0) 编辑
摘要:[WebMethod] public int DoMulti(int num1,int num2) { int result; result = num1 * num2; return result; } Javascript ... 阅读全文
posted @ 2007-09-05 00:58 Samgle 阅读(457) 评论(0) 推荐(0) 编辑
摘要:SyntaxHighlighter is here to help a developer/coder to post code snippets online with ease and have it look pretty. It's 100% Java Script based and it doesn't care what you have on your server. Hi... 阅读全文
posted @ 2007-08-23 14:53 Samgle 阅读(432) 评论(0) 推荐(0) 编辑
摘要:document.body.oncopy = function () { setTimeout( function () { var text = clipboardData.getData("text"); if (text) { text = text + "\r\n转载自"+location.href; clipboardData.setData(... 阅读全文
posted @ 2007-08-20 21:37 Samgle 阅读(295) 评论(0) 推荐(0) 编辑
摘要:function StringBuffer(){this.data = [];}StringBuffer.prototype.append = function(){this.data.push(arguments[0]);return this;}StringBuffer.prototype.toString = function(){return this.data.join("");} ... 阅读全文
posted @ 2007-07-18 01:17 Samgle 阅读(687) 评论(1) 推荐(0) 编辑
摘要:特点:1、兼容 IE6、FF、Opear(IE7还没有机会测试)2、拖动流畅3、起点与终点之间有过渡,使移动更平滑(可调) 演示 /* Author:misshjn HomePage:http://www.happyshow.org Date:2007-04-30 拖动开始*/function _getStyle(element,styleProp){ if (el... 阅读全文
posted @ 2007-07-18 01:13 Samgle 阅读(334) 评论(0) 推荐(0) 编辑