365key.com
发现·保存·分享@天天网摘

Q版365key  设为首页 加为收藏 帮助

 首页  网址  添加  我的网摘  我的订阅  最新网摘  收录榜  点击榜  同好  配置  工具箱  标签  兴趣小组 
  IT168 |  华军下载 |  猫扑 |  VeryCD |  CSDN技术 |  DoNews |  9Flash |  中金 |  游侠 |  股票天下 |  游戏公会 |  电子工程 |  白银时代 |  和365Key合作

yadan的网摘列表 RSS格式输出  365Key邮件订阅,每天可以定期收到邮件通知  使用 POTU 订阅
搜索词: 时间:
分类:     排序:
 
刷新列表 共2页、51项网摘
经典正则表达式 (收藏整理)- 文武之道 - 新浪BLOG点击:56
 分类:javascript 时间:2007-1-1 9:39:01 yadan收录 (还有3人收录) 复制到我的网摘
正则表达式用于字符串处理,表单验证等场合,实用高效,但用到时总是不太把握,以致往往要上网查一番。我将一些常用的表达式收藏在这里,作备忘之用。本贴随时会更新。

匹配中文字符的正则表达式: [\u4e00-\u9fa5]

匹配双字节字符(包括汉字在内):[^\x00-\xff]

应用:计算字符串的长度(一个双字节字符长度计2,ASCII字符计1)

String.prototype.len=function(){return this.replace([^\x00-\xff]/g,"aa").length;}

匹配空行的正则表达式:\n[\s| ]*\r

匹配HTML标记的正则表达式:/<(.*)>.*<\/\1>|<(.*) \/>/

匹配首尾空格的正则表达式:(^\s*)|(\s*$)



String.prototype.trim = function()
{
return this.replace(/(^\s*)|(\s*$)/g, "");
}

利用正则表达式分解和转换IP地址:

下面是利用正则表达式匹配IP地址,并将IP地址转换成对应数值的Javascript程序:

function IP2V(ip)
{
re=/(\d+)\.(\d+)\.(\d+)\.(\d+)/g //匹配IP地址的正则表达式
if(re.test(ip))
{
return RegExp.$1*Math.pow(255,3))+RegExp.$2*Math.pow(255,2))+RegExp.$3*255+RegExp.$4*1
}
else
{
throw new Error("Not a valid IP address!")
}
}

不过上面的程序如果不用正则表达式,而直接用split函数来分解可能更简单,程序如下:

var ip="10.100.20.168"
ip=ip.split(".")
alert("IP值是:"+(ip[0]*255*255*255+ip[1]*255*255+ip[2]*255+ip[3]*1))

匹配Email地址的正则表达式:\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*

匹配网址URL的正则表达式:http://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?

利用正则表达式去除字串中重复的字符的算法程序:[注:此程序不正确,原因见红色字体]

var s="abacabefgeeii"
var s1=s.replace(/(.).*\1/g,"$1")
var re=new RegExp("["+s1+"]","g")
var s2=s.replace(re,"")
alert(s1+s2) //结果为:abcefgi

===============================
如果var s = "abacabefggeeii"
结果就不对了,结果为:abeicfgg
正则表达式的能力有限

我原来在CSDN上发贴寻求一个表达式来实现去除重复字符的方法,最终没有找到,这是我能想到的最简单的实现方法。思路是使用后向引用取出包括重复的字符,再以重复的字符建立第二个表达式,取到不重复的字符,两者串连。这个方法对于字符顺序有要求的字符串可能不适用。

得用正则表达式从URL地址中提取文件名的javascript程序,如下结果为page1

s="http://www.9499.net/page1.htm"
s=s.replace(/(.*\/){0,}([^\.]+).*/ig,"$2")
alert(s)

利用正则表达式限制网页表单里的文本框输入内容:

用正则表达式限制只能输入中文:onkeyup="value=value.replace(/[^\u4E00-\u9FA5]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\u4E00-\u9FA5]/g,''))"

用正则表达式限制只能输入全角字符: onkeyup="value=value.replace(/[^\uFF00-\uFFFF]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\uFF00-\uFFFF]/g,''))"

用正则表达式限制只能输入数字:onkeyup="value=value.replace(/[^\d]/g,'') "onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"

用正则表达式限制只能输入数字和英文:onkeyup="value=value.replace(/[\W]/g,'') "onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"
转自:动态网站制作指南 | www.knowsky.com
http://blog.sina.com.cn/u/490d26b40100073j
WYMeditor - standards-compliant XHTML editor - Home点击:48
 分类:javascript; HTML在线编辑器 时间:2006-12-21 3:00:55 yadan收录 复制到我的网摘
WYMeditor: web-based XHTML editor
Overview

WYMeditor is a web-based WYSIWYM XHTML editor.

WYMeditor's main concept is to leave details of the document's visual layout, and to concentrate on its structure and meaning, while trying to give the user as much comfort as possible (at least as WYSIWYG editors).

WYMeditor has been created to generate perfectly structured XHTML strict code, to conform to the W3C XHTML specifications and to facilitate further processing by modern applications.

With WYMeditor, the code can't be contaminated by visual informations like font styles and weights, borders, colors, ...
The end-user defines content meaning, which will determine its aspect by the use of style sheets. The result is easy and quick maintenance of information.

As the code is compliant to W3C XHTML specifications, you can for example process it using a XSLT (at the client or the server side), giving you a wide range of applications.
http://www.wymeditor.org/en/
SOLMETRA - web based WYSIWYG editor control - SPAW Editor, online regular expression test tool, wrapper for Google Maps点击:57
 分类:javascript; HTML在线编辑器 时间:2006-12-21 2:37:33 yadan收录 复制到我的网摘
spaw editor sf上的一个开源!
http://www.solmetra.com/en/disp.php/en_products/en_spaw/en_spaw_demo
Javascript Closures点击:38
 分类:javascript 时间:2006-12-20 18:00:08 yadan收录 复制到我的网摘
Closure
A "closure" is an expression (typically a function) that can have free variables together with an environment that binds those variables (that "closes" the expression).
http://jibbering.com/faq/faq_notes/closures.html
dappad: today点击:44
 分类:javascript; web2.0; HTML在线编辑器 时间:2006-12-17 15:09:36 yadan收录 复制到我的网摘
貌似不错的html在线编辑器,可以写随便什么东西?
http://www.dappad.com/
Creating an HTML Text Area Server Side Control - The Code Project - ASP.NET点击:41
 分类:javascript; HTML在线编辑器 时间:2006-12-17 9:22:15 yadan收录 复制到我的网摘
Creating an HTML Text Area Server Side Control - The Code Project - ASP.NET
http://www.codeproject.com/aspnet/text_area_control.asp?df=100&forumid=14191&exp=0&select=1259268
DOM:Selection - MDC点击:33
 分类:javascript; HTML在线编辑器 时间:2006-12-15 2:26:05 yadan收录 复制到我的网摘
DOM:Selection mozilla
http://developer.mozilla.org/en/docs/DOM:Selection
Frequently Asked Questions About the Dynamic HTML Editing Component (Archived Microsoft Dynamic HTML Editing Component Technical Articles)点击:37
 分类:javascript; HTML在线编辑器 时间:2006-12-15 1:51:51 yadan收录 (还有1人收录) 复制到我的网摘
DHTML Editing Component

Frequently Asked Questions About the Dynamic HTML Editing Component
Mark Davis and Rick Jesse
DHTML Editing Component Support and Development Team

Updated September 10, 1998

Questions
What is the Dynamic HTML Editing Component?
Who would benefit from using this component?
Where can software vendors obtain the component?
Where can I learn more about the DHTML Editing Component?
Where can I learn more about Dynamic HTML?
Will the DHTML Editing Component work with the Internet Explorer 5 Developer Preview?
How do I use the DHTML Editing control?
How do I load HTML into the component from memory?
How do I access the Internet Explorer Document Object Model from the DHTML Editing Component?
How do I insert new elements into a document?
How do I insert script into the document?
How do I use ExecCommand and QueryStatus?
How do I update my application's menus and toolbars based on the current selection?
How do I implement my own commands?
How do I obtain the currently selected text?
How do I find the selected element or the element under the insertion point?
How do I programatically set the position of the insertion point?
How do I trap an event such as ondoubleclick?
How do I sync document object model events in Visual Basic?
Why does my onclick event handler never get called?
How do I display a context menu?
How can I remove the underline from a hyperlink?
Does the DHTML Editing Component support drag-and-drop from an external source?
How can I receive drop notifications?
How do I print programmatically?
What are the DESIGNTIMESP attributes that I see in an element's outerHTML?
What are the licensing terms for the editing component?
How do I redistribute the DHTML Editing Component with my application?



http://msdn.microsoft.com/archive/en-us/dnaredcom/html/edcomfaq.asp?frame=true
DHTML Editing Component Overview (Archived Microsoft Dynamic HTML Editing Component Technical Articles)点击:33
 分类:javascript; HTML在线编辑器 时间:2006-12-15 1:50:42 yadan收录 复制到我的网摘
DHTML Editing Component Overview
This document describes technologies that are available in Internet Explorer 5. An earlier version of the DHTML Editing Component that is compatible with Internet Explorer 4.01 is available as an SDK that you can download.

Microsoft Corporation

Updated June 11, 1999

Welcome to the Microsoft?Dynamic HTML Editing Component (DHTML Editing Component) documentation. This documentation is designed to help application developers, script authors, and Web developers use the DHTML Editing Component to build applications and use the ActiveX Editing Control.

Overview of the DHTML Editing Component
The Microsoft Dynamic HTML (DHTML) Editing Component allows Web authors and application developers to add WYSIWYG DHTML editing capabilities to their Web sites and applications. The editing component uses Microsoft's Component Object Model (COM) technology to provide access to editing services such as basic HTML formatting, tables, undo and redo, and absolute positioning.

The DHTML Editing Component uses Microsoft?Internet Explorer to parse and render HTML, so the editing environment provides a faithful representation of what the document will look like in the browser. Web authors and developers can use any language, including Visual Basic? Visual Basic Scripting Edition (VBScript), JScript? C, C++, and Java to access editing services and provide a user interface for editing features.

Web authors and developers can also access the DHTML document object model (DOM) to add sophisticated, custom editing features to their applications. If you begin with existing HTML, the DHTML Editing Component will preserve your original formatting (the original white space and tags will remain). In addition, you can edit pages created with Active Server Pages technology seamlessly, without changing the original server script.

In this section of the documentation, you can find the following general information about the DHTML Editing Component:

http://msdn.microsoft.com/archive/en-us/dnaredcom/html/cncpt.asp?frame=true
IE的模态对话框里的问题还真是不少 - 鸟食轩 - 博客园点击:64
 分类:javascript 时间:2006-12-14 14:12:22 yadan收录 复制到我的网摘
IE的模态对话框里的问题
http://www.cnblogs.com/birdshome/archive/2005/01/14/91586.html
CSDN技术中心 showModalDialog和showModelessDialog使用心得点击:71
 分类:javascript 时间:2006-12-14 12:14:52 yadan收录 复制到我的网摘
showModalDialog和showModelessDialog使用心得

一、showModalDialog和showModelessDialog有什么不同?
  showModalDialog:被打开后就会始终保持输入焦点。除非对话框被关闭,否则用户无法切换到主窗口。类似alert的运行效果。
  showModelessDialog:被打开后,用户可以随机切换输入焦点。对主窗口没有任何影响(最多是被挡住一下而以。:P)

二、怎样才让在showModalDialog和showModelessDialog的超连接不弹出新窗口?
  在被打开的网页里加上就可以了。这句话一般是放在和之间的。

三、怎样才刷新showModalDialog和showModelessDialog里的内容?
  在showModalDialog和showModelessDialog里是不能按F5刷新的,又不能弹出菜单。这个只能依靠javascript了,以下是相关代码:


reload...

  将filename.htm替换成网页的名字然后将它放到你打开的网页里,按F5就可以刷新了,注意,这个要配合使用,不然你按下F5会弹出新窗口的。

http://dev.csdn.net/develop/article/27/27760.shtm
Javascript - Benchmark - W3C DOM vs. innerHTML点击:33
 分类:javascript; CSS 时间:2006-12-13 21:35:13 yadan收录 (还有1人收录) 复制到我的网摘
Benchmark - W3C DOM vs. innerHTML
show page contentsTop
Experiments
Absolute numbers
Discussion
Explorer Windows
Mozilla
Opera
Explorer Mac
Safari
iCab
The test tableshow site navigation
Loading site navigation; please wait...
Section 8F of the book discusses innerHTML and when it's preferable to "real" W3C DOM methods.
This is a test page intended to find out which method of generating large amounts of content is fastest in the browsers. Of course the results differ significantly from browser to browser.

Each of the test scripts creates a 50x50 table, all of whose cells are filled with one character, *. Then the time your browser needs is measured and compared to the time it needed to execute the other methods.

Experiments
http://www.quirksmode.org/dom/innerhtml.html
Aptana: The Web IDE点击:27
 分类:javascript; Java技术 时间:2006-12-13 17:55:59 yadan收录 (还有8人收录) 复制到我的网摘
Aptana js css编辑器 eclipse插件!
http://www.aptana.com/
HTML2XHTML Converter点击:16
 分类:javascript; HTML在线编辑器 时间:2006-12-12 10:31:54 yadan收录 复制到我的网摘
HTML2XHTML JavaScript Converter (H2X) generates a well-formed XHTML code from an HTML DOM object.

H2X could be used in Content Management Systems (CMS), online wysiwyg html editors or any other javascript application to produce well-formed XHTML 1.0 code. Example of using the H2X could be found on Rich Editor site (http://richarea.com/demo/)

H2X works in MS IE 5.0 for Windows or above, Netscape 7.1, Mozilla 1.3 or above. It should work in all Mozilla based browsers (eg Firefox 0.8+).

H2X is absolutely free for using in non-commercial applications. Click here for demo!

Newest modifications:
- indents added to html tags to improve formatting of resulting output
- html special chars converted to the appropriate html entities
http://html2xhtml.richarea.com/
IFRAME Element | iframe Object点击:41
 分类:javascript 时间:2006-12-7 18:04:13 yadan收录 复制到我的网摘
微软关于iframe的属性!
http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/IFRAME.asp?frame=true
关于document.execCommand()函数可用参数大解析点击:69
 分类:javascript 时间:2006-12-7 17:57:44 yadan收录 复制到我的网摘
关于document.execCommand()函数可用参数大解析
非常全!!!
http://www.qqhit.com/article/30/Article17223_1.htm
Yahoo! mail and Hotmail like Rich Text Editor - The Code Project - JavaScript点击:64
 分类:javascript; HTML在线编辑器 时间:2006-12-7 17:48:55 yadan收录 复制到我的网摘
怎么作一个rich text editor 很好的一篇教程和实例!
http://www.codeproject.com/jscript/w3richtechedit.asp
黑了你的站站 ^_^ (本版块第一百贴) - WebUI研究 - 论坛 - goCom - 面向构件成长社区点击:63
 分类:javascript 时间:2006-12-7 17:41:26 yadan收录 复制到我的网摘
很好的javascript代码!
http://gocom.primeton.com/modules/newbb/item14585_14585.htm?PHPSESSID=bb1e6342398265934270233b447c3e...
Flexible floats 3 | Blog | 1976design.com点击:41
 分类:javascript; CSS 时间:2006-11-30 23:49:58 yadan收录 复制到我的网摘
Flexible floats 3
http://1976design.com/blog/archive/2004/03/28/flexible-floats-3/
CSS Image Maps - Flickr-like Technique?点击:32
 分类:javascript; CSS 时间:2006-11-30 23:47:58 yadan收录 (还有3人收录) 复制到我的网摘
css image map
http://www.frankmanno.com/ideas/css-imagemap/
CSS Vault ?The Web's CSS Site点击:18
 分类:javascript; CSS 时间:2006-11-30 23:45:26 yadan收录 (还有15人收录) 复制到我的网摘
css vault 很多css javascript信息
http://cssvault.com/
Dynamic Drive DHTML Scripts- Tab Content Script点击:41
 分类:javascript; CSS 时间:2006-11-30 23:44:06 yadan收录 复制到我的网摘
css tab浏览
http://www.dynamicdrive.com/dynamicindex17/tabcontent.htm
gotAPI/search API搜索点击:27
 分类:javascript; Java技术; java建站 时间:2006-11-21 0:59:19 yadan收录 (还有3人收录) 复制到我的网摘
API搜索
http://start.gotapi.com/
AJAX tools by Zapatec点击:55
 分类:javascript; ajax 时间:2006-11-11 11:31:54 yadan收录 复制到我的网摘
Zapatec provides tools to help you quickly deploy effective AJAX applications. Using the Zapatec AJAX Suite you can start with one or two components, and migrate to using the full range of widgets and components. More ... NEW REVIEW: "This is one of the most impressive commercial Ajax/DHTML suites I’ve encountered since starting this list."(read more) – in the AJAX Mars Report
http://www.zapatec.com/website/main/
dhtmlxTree - AJAX powered DHTML JavaScript Tree component with rich API点击:58
 分类:javascript; ajax 时间:2006-11-6 0:03:07 yadan收录 (还有2人收录) 复制到我的网摘
不错的javascript tree menu组件
http://www.scbr.com/docs/products/dhtmlxTree/index.shtml
Simple Tabber Example点击:38
 分类:javascript; CSS 时间:2006-10-24 21:32:16 yadan收录 复制到我的网摘
tab标签页 css 和js实现
http://www.barelyfitz.com/projects/tabber/example.html
毅博客-标准的下拉菜单点击:46
 分类:javascript; CSS 时间:2006-10-24 21:31:49 yadan收录 复制到我的网摘
在网上看到很多的下拉菜单,要就是不符合Xhtml的标准,要么就用一大堆的JS代码来实现。以下是我在网上收集到的很简单的下拉菜单,JS文件也很简单。

Home About Jeremy This Site Resume Archive Portfolio Web Design Motion Print design Links Contact
http://andymao.com/andy/post/8.html
毅博客-淡泊明志,宁静致远点击:62
 分类:javascript; CSS 时间:2006-10-24 18:10:36 yadan收录 复制到我的网摘
很好的css html设计博客
http://www.andymao.com/andy/
浏览器的GreaseMonkey和Trixie插件 - 月光博客点击:52
 分类:web2.0; javascript; 浏览器插件 时间:2006-9-25 11:29:08 yadan收录 (还有5人收录) 复制到我的网摘
呵呵
http://www.williamlong.info/archives/252.html
用函数式编程技术编写优美的 JavaScript点击:45
 分类:javascript 时间:2006-7-26 18:01:07 yadan收录 (还有2人收录) 复制到我的网摘
Array.prototype.fold=function(templateFn) {
var len=this.length;
var str=' ';
for (var i=0 ; i str+=templateFn(this[i]);
return str;
}

function templateInstance(element) {
return ... HTML generation code ...
}

document.write(arr.fold(templateInstance));
http://www-128.ibm.com/developerworks/cn/web/wa-javascript.html
页码: [1 2 共2页、51项网摘

使用帮助 |  如何保存网摘 |  给365Key提建议 |  媒体报道 |  站长推广须知
Copyright (C) 2004 365Key.com--天天网摘 All Rights Reserved