??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲精品无码不卡在线播HE,亚洲国产精品久久久久,亚洲精品永久在线观看http://www.tkk7.com/lqxue/category/20631.htmlzh-cnSat, 12 Jun 2010 07:34:26 GMTSat, 12 Jun 2010 07:34:26 GMT60如何?Windows 中删?ActiveX 控ghttp://www.tkk7.com/lqxue/archive/2010/06/08/323068.htmllqxlqxTue, 08 Jun 2010 08:16:00 GMThttp://www.tkk7.com/lqxue/archive/2010/06/08/323068.htmlhttp://www.tkk7.com/lqxue/comments/323068.htmlhttp://www.tkk7.com/lqxue/archive/2010/06/08/323068.html#Feedback0http://www.tkk7.com/lqxue/comments/commentRss/323068.htmlhttp://www.tkk7.com/lqxue/services/trackbacks/323068.html删除 ActiveX 控gQ请按照相应部分中的步骤操作?

Internet Explorer 3.0?.01 ?3.02

  1. 单击“开?#8221;Q指?#8220;讄”Q单?#8220;控制面板”Q双?#8220;d/删除E序”Q然后单?#8220;安装/卸蝲”选项卡?
  2. 如果(zhn)要删除?ActiveX 控g出现在安装的E序列表中,请单击该 ActiveX 控gQ单?#8220;d/删除”Q然后按照屏q上的说明操作。如果该 ActiveX 控g没有出现在安装的E序列表中,则l执行下一步?
  3. 单击“开?#8221;Q单?#8220;q行”Q在“打开”框中键入下列行,然后单击“定”Q?
    regsvr32 drive:\windows\occache\filename.ocx /u
    注意Q?var>drive ?Windows 文gҎ(gu)在的驱动器号Q?var>windows 是安?Windows 的文件夹名,?filename.ocx 是?zhn)惌删除?ActiveX 控g?br />
    注意Q如果?zhn)不知道要删除?ActiveX 控g (.ocx) 的文件名Q则可以通过查看安装或?ActiveX 控g的网늚文本标记语a (HTML) 源文件来定该文件名。要查看一个网늚 HTML 源文Ӟ请右键单击该|页的空白区域,然后单击“查看源文?#8221;?
  4. ?Windows 资源理器或 Windows NT 资源理器中Q单?Windows\Occache 文g夹中?.ocx 文gQ然后单?#8220;文g”菜单上的“删除”?/li>

Occache 是在 Internet Explorer 3.x 的所有版本中安装?ActiveX 控g的文件夹的名U。Regsvr32.exe 文g是由 Internet Explorer 安装的,q且可用于注册和删除 ActiveX 控g的注册表V?

Internet Explorer 4.x 或更高版本(所有^収ͼ(j)

Internet Explorer 4.x 或更高版本,包括 Occache.dll 文gQ该文g可用于?#8220;shell 文g?#8221;枚D、更新和安全地卸?ActiveX 控g?

  1. 单击“开?#8221;Q指?#8220;讄”Q单?#8220;控制面板”Q双?#8220;d/删除E序”Q然后单?#8220;安装/卸蝲”选项卡?
  2. 如果(zhn)要删除?ActiveX 控g出现在安装的E序列表中,请单击该 ActiveX 控gQ单?#8220;d/删除”Q然后按照屏q上的说明操作。如果该 ActiveX 控g没有出现在安装的E序列表中,则l执行下一步?
  3. ?Windows 资源理器或 Windows NT 资源理器中Q双?Windows\Downloaded Program Files 文gҎ(gu) Winnt\Downloaded Program Files 文g夹,右键单击(zhn)想要删除的 ActiveX 控gQ然后单?#8220;删除”?
  4. 在系l提C?zhn)是否删除?ActiveX 控g后,单击“?#8221;?/li>

重要说明Q如果?zhn)q行的是 Internet Explorer 4.0Q则不应删除以下 ActiveX 控gQ?

  • DirectAnimation Java Classes
  • Internet Explorer Classes for Java
  • Microsoft XML Parser for Java
  • Win32 Classes

Internet Explorer 5.0 或更高版本不要求 Downloaded Program Files 文g中的q些lg?

删除 ActiveX 控g时出现的错误消息

在?zhn)试使?Occache shell 文g夹删除一?ActiveX 控gӞ可能昄以下错误消息之一Q?

  • ׃n冲突 q些E序文g当前正由一个或多个E序使用。请关闭一些程序,然后重试。?zhn)可能需要重新启?Windows?
  • lg删除 卛_删除 Windows pȝ DLL:(<path\filename>)。是否删?

׃n冲突:

如果(zhn)要试删除?ActiveX 控g当前在内存(sh)?Internet Explorer ?#8220;zd桌面”lg加蝲Q则昄此错误消息?br />
要解x(chng)错误消息Q请按照下列步骤操作Q?

  1. 关闭所有打开?Internet Explorer H口?
  2. 用“zd桌面”。ؓ(f)此,请右键单?yn)L面上的空白区域,指向“zd桌面”Q然后单?#8220;查看|页”以清除该复选标记?
  3. 按照本文中前面部分的“Internet Explorer 4.0 或更高版?#8221;部分中介l的步骤Q删除该 ActiveX 控g?br />
    注意Q?zhn)最好在删除 ActiveX 控g前重新启?Windows?/li>

lg删除Q?br />
仅当(zhn)要删除?ActiveX 控g向已注册?Occache 文g夹以外的文g夹(例如QW(xu)indows\System ?Winnt\System32Q安装文件时Q该消息才出现在 4.01 Service Pack 1 (SP1) 之前?Internet Explorer 4 版本中。Occache 不是总能定q些文g是否正由其程序共享?

如果(zhn)确定消息中昄的一个或多个文g未由 Windows 或其他程序用,请单?#8220;?#8221;。否则,单击“?#8221;?

注意Q在 Internet Explorer 4.01 SP1 和更高版本中QOccache 不删除(或提C?zhn)删除Q注册的 Occache 文g夹之外的相关文g?

支持多个 Occache 文g?/h3>

Internet Explorer 4.0 和更高版本支持多?Occache 文g夏VOccache 文g夹的列表位于以下注册表项中:(x)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ActiveX Cache

默认情况下,Internet Explorer 4.0 和更高版本?Windows\Downloaded Program Files ?Winnt\Downloaded Program Files 文g夏V如果是?Internet Explorer 3.x 升的,?Occache ?Downloaded Program Files 文g夹可能都存在。在此情况下Q所有新?ActiveX 控g都安装在 Downloaded Program Files 文g夹中Q但以前安装?ActiveX 控g仍在 Occache 文g夹中工作。当(zhn)在 Windows 资源理器、Windows NT 资源理器或“我的?sh)?#8221;中打开 Occache ?Downloaded Program Files 文gҎ(gu)Q将昄所?ActiveX 控gQ而与?ActiveX 控g的文件所在的文gҎ(gu)兟뀂在此情况下Q注册表中出C下字W串|(x)

"0"="C:\\WINDOWS\\OCCACHE"
"1"="C:\\WINDOWS\\Downloaded Program Files"

有关 ActiveX 控g的其他信息,请参?Microsoft 知识库中的以下文章:(x)

154544  (http://support.microsoft.com/kb/154544/LN/ ) ActiveX 技术说?

有关 Internet Explorer 在发生冲H(例如Q如果文件已存在Q时如何下蝲 ActiveX 控g的信息,请参?Microsoft 知识库中的以下文章:(x)

196150  (http://support.microsoft.com/kb/196150/LN/ ) INFOQؓ(f)什么会(x)在代码下载期间创?CONFLICT 目录


lqx 2010-06-08 16:16 发表评论
]]>html 导出excelhttp://www.tkk7.com/lqxue/archive/2010/03/21/316057.htmllqxlqxSun, 21 Mar 2010 01:42:00 GMThttp://www.tkk7.com/lqxue/archive/2010/03/21/316057.htmlhttp://www.tkk7.com/lqxue/comments/316057.htmlhttp://www.tkk7.com/lqxue/archive/2010/03/21/316057.html#Feedback0http://www.tkk7.com/lqxue/comments/commentRss/316057.htmlhttp://www.tkk7.com/lqxue/services/trackbacks/316057.html阅读全文

lqx 2010-03-21 09:42 发表评论
]]>
无提C框关闭览?/title><link>http://www.tkk7.com/lqxue/archive/2010/03/15/315483.html</link><dc:creator>lqx</dc:creator><author>lqx</author><pubDate>Mon, 15 Mar 2010 06:36:00 GMT</pubDate><guid>http://www.tkk7.com/lqxue/archive/2010/03/15/315483.html</guid><wfw:comment>http://www.tkk7.com/lqxue/comments/315483.html</wfw:comment><comments>http://www.tkk7.com/lqxue/archive/2010/03/15/315483.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/lqxue/comments/commentRss/315483.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/lqxue/services/trackbacks/315483.html</trackback:ping><description><![CDATA[window.open(....);<br /> this.focus();  self.opener = this;  self.close();<br /> <img src ="http://www.tkk7.com/lqxue/aggbug/315483.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/lqxue/" target="_blank">lqx</a> 2010-03-15 14:36 <a href="http://www.tkk7.com/lqxue/archive/2010/03/15/315483.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>IE foolscreen/全屏 览面http://www.tkk7.com/lqxue/archive/2010/03/15/315481.htmllqxlqxMon, 15 Mar 2010 06:22:00 GMThttp://www.tkk7.com/lqxue/archive/2010/03/15/315481.htmlhttp://www.tkk7.com/lqxue/comments/315481.htmlhttp://www.tkk7.com/lqxue/archive/2010/03/15/315481.html#Feedback0http://www.tkk7.com/lqxue/comments/commentRss/315481.htmlhttp://www.tkk7.com/lqxue/services/trackbacks/315481.html
1. window.open('http://www.sina.com.cn','','fullscreen')
   Note: If view the page remotely, this way will ineffective, and you can use the second one instead.
 

2. var wsh=new ActiveXObject("wscript.shell");
   wsh.run("iexplore -k http://www.google.com");
 



lqx 2010-03-15 14:22 发表评论
]]>
IE7: Automation server can't create object javascripthttp://www.tkk7.com/lqxue/archive/2010/03/15/315480.htmllqxlqxMon, 15 Mar 2010 06:14:00 GMThttp://www.tkk7.com/lqxue/archive/2010/03/15/315480.htmlhttp://www.tkk7.com/lqxue/comments/315480.htmlhttp://www.tkk7.com/lqxue/archive/2010/03/15/315480.html#Feedback0http://www.tkk7.com/lqxue/comments/commentRss/315480.htmlhttp://www.tkk7.com/lqxue/services/trackbacks/315480.html  
1. In Internet Explorer > Tools > Internet Options > Security > Custom Level
2. Enabling or prompting "Initializing and Script Activex controls not marked as safe"



3.IE7对环境的讄特别严格Q常用到的有两部分,一个是安全里面?#8220;internet”讄Q一个是“信Q站点”的设|?br />
  1>需要把站点加入信Q站点列表Q?br />   2>讄“信Q站点”的“自定义?#8221;Q启?#8220;Ҏ(gu)标记为可安全执行 ActiveX控g初始化ƈ执行脚本”卛_?br />

lqx 2010-03-15 14:14 发表评论
]]>
用javascript操控csshttp://www.tkk7.com/lqxue/archive/2010/03/12/315239.htmllqxlqxFri, 12 Mar 2010 02:58:00 GMThttp://www.tkk7.com/lqxue/archive/2010/03/12/315239.htmlhttp://www.tkk7.com/lqxue/comments/315239.htmlhttp://www.tkk7.com/lqxue/archive/2010/03/12/315239.html#Feedback0http://www.tkk7.com/lqxue/comments/commentRss/315239.htmlhttp://www.tkk7.com/lqxue/services/trackbacks/315239.html From: http://www.quirksmode.org/dom/w3c_css.html#access




lqx 2010-03-12 10:58 发表评论
]]>
CSS 控制打印http://www.tkk7.com/lqxue/archive/2010/03/12/315237.htmllqxlqxFri, 12 Mar 2010 02:55:00 GMThttp://www.tkk7.com/lqxue/archive/2010/03/12/315237.htmlhttp://www.tkk7.com/lqxue/comments/315237.htmlhttp://www.tkk7.com/lqxue/archive/2010/03/12/315237.html#Feedback0http://www.tkk7.com/lqxue/comments/commentRss/315237.htmlhttp://www.tkk7.com/lqxue/services/trackbacks/315237.html
Web Page Printability With CSS
author: Martin "mpot" Pot
date: 7 January 2005


Introduction

This article describes how to use CSS media types to make your website much more printer-friendly. An overview of CSS media types is given, and sample HTML and CSS code is provided, detailing how to implement CSS media types for improving printability.

Why?

Most webpages do not print very well, with large amounts of the printed page being wasted with banners, navigation menus, advertising, and other unnecessary content. When attempting to print out the main text of a webpage, you often have to resort to copying the text into Word or another editor, and then printing it.

Some websites make use of a link at the bottom of the page, linking to a "printable version" of the same page. However, this requires additional effort on the part of the web developer.

There is a much easier way to make your pages print better, and that's via the use of CSS media types.

For example, all content on MartyBugs.Net has been designed to be printer-friendly. When printing pages from this site using a modern browser, elements such as the left menu column and the right column (where used) will be hidden, thus ensuring there's more room on the printed page for the main content.

page viewed on screen
page as displayed on a 1024x768 screen

The image above shows how one of the pages on this website would be displayed on a computer screen, at a resolution of 1024x768.

printed page
printed page, optimised with CSS media types
printed page,
no print optimisation

printed page,
optimised for printing

The left image above shows how the same page will look when printed, if all the page content is printed. Notice how little room there is in the centre of the page for the main content.

The right image above shows the same page, but the navigation and other content on the left and right hand sides of the page is not printed. CSS media types have been used to hide this content when the page is printed.

CSS Media Types

The primary aim of the CSS media types is to allow the web-page author to define different styles for a page, depending on the media being used to display the page. CSS 2.1 supports numerous media types, including all (suitable for all devices), screen (computer screens), print (pages viewed on-screen in print-preview mode and printed pages).
Other less-common media types are also supported, such as braille, embossed, handheld, projection, speech, etc, but we won't be discussing any of these.

CSS media types are defined using the rule in your CSS style-sheet, or in your in-line CSS style definitions. For example, to define different font sizes for the print and screen media types, as well as a common line-height to be used for both, the CSS definition is as follows:

  @media print {
body { font-size: 10pt }
}
@media screen {
body { font-size: 13px }
}
@media screen, print {
body { line-height: 1.2 }
}

The CSS media types allow you to specify different CSS properties for any element, so it will be displayed differently on the screen than when printed. For the purposes of this article, the only thing we're interested in is to hide some page elements when the page is printed.

Refer to the W3C CSS 2.1 Media Definitions for more details on CSS media types.

Using CSS Media Types

The web pages on this website are all generated on-the-fly, using server-side Perl templates. All pages have a number of common elements, namely:
  • a banner across the top
  • navigation menu on the left side
  • main content in the centre
  • advertising and other content on the right side
  • footer across the bottom
When someone prints out a page from this website, CSS media types are used to hide a number of elements on the page, including the navigation menu, advertising, and the navigation content in the footer.

To provide a working demonstration of how CSS media types can be used in this way, a demonstration web page was coded, using tables to define the banner area across the top of the page, with a column down the left-hand side for the navigation menu, a column down the right-hand side for other content, and a footer across the bottom of the page.

This layout is one of the most commonly used page layouts on the internet at the present - hence my choice to use it as an example.

the example page
the example page

Firstly, we define the CSS styles for the page:

  <style type="text/css">
@media print {
.noprint { display: none; }
}

</style>

Note that the CSS styles can also be defined using a separate CSS file, but example page has the CSS defined in-line for simplicity (and to keep the example to a single file).

The above CSS definition is defining a style called noprint, and will only be applied to printed content. Setting the display property to none means any content using this CSS style will not be displayed when printed, but will be displayed for all other media types.

There are a number of components on this page that we don't want printed, namely the columns on the left-hand side and on the right-hand side. The noprint style is applied to the table cells holding this content, thus ensuring they won't be visible when the page is printed.

<table border='1' cellpadding='4' cellspacing='0' width='100%' >
<tr height='60'><td colspan='3'>
banner place-holder
</td></tr>
<tr><td width='150' valign='top' class='noprint'>
left-side content place-holder
</td><td>
<b>main content</b>
[snip!]
</td><td width='150' valign='top' class='noprint'>
right-side content place-holder
</td></tr><tr><td colspan='3'>
footer content place-holder
</td></tr>
</table>

This will result in the columns on the left and right-hand sides being hidden when the page is printed, thus providing more space on the printed page for the content itself.

Note that this style needs to be applied to the table cells themselves, and not just to the content in these table cells, else the (empty) cells will still show up on the printed copy.

Testing Your CSS

The easiest way to test CSS styles for print media is to use a web browser which has print preview capabilities. The print preview will give you a fairly accurate representation of how the page will look when it is printed, and is a much more efficient way to test your media styles, rather than actually printing out pages on a printer.

Most popular web browsers should support print preview functionality. The FireFox browser has print preview functionality, although it lacks any zoom/unzoom capabilities.

As an alternative to using print preview, you can print the web page to a PDF file. There are numerous (costly, freeware, and anywhere in between) software packages for doing this. I recommend using the freeware and open-source PDFCreator, which is a Windows printer driver which allows you to create PDFs from any Windows application, just by selecting the PDFCreator driver as the virtual printer from that application.

Also be sure to use the W3C's free CSS Validation Service to check your CSS definitions.

References




lqx 2010-03-12 10:55 发表评论
]]>
正则表达?regular expression)http://www.tkk7.com/lqxue/archive/2008/11/24/242264.htmllqxlqxMon, 24 Nov 2008 06:32:00 GMThttp://www.tkk7.com/lqxue/archive/2008/11/24/242264.htmlhttp://www.tkk7.com/lqxue/comments/242264.htmlhttp://www.tkk7.com/lqxue/archive/2008/11/24/242264.html#Feedback0http://www.tkk7.com/lqxue/comments/commentRss/242264.htmlhttp://www.tkk7.com/lqxue/services/trackbacks/242264.html正则表达?regular expression)

关键字:(x) 正则表达式,Regular Expression

作者:(x)W容

发表于:(x)2004q?5?3?br /> 最后更斎ͼ(x)2005q?1?7? 19:54
版权声明Q?/font>创作公用版权协议

引用地址Q?lt;a >正则表达?regular expression)</a>

NAV: W容的八时?/font> / W容的八时外资料烦(ch)?/font>

如何创徏一个网?(HOW TO: Initiate a website) Red Hat Enterprise Linux 介绍


前言

正则表达式是?ch)琐的,但是强大的,学?x)之后的应用会(x)让你除了(jin)提高效率外,?x)给你带来绝对的成就感。只要认真去阅读q些资料Q加上应用的时候进行一定的参考,掌握正则表达式不是问题?/p>

索引

1._引子
2._正则表达式的历史
3._正则表达式定?/font>

3.1_普通字W?/font>
3.2_非打印字W?/a>
3.3_Ҏ(gu)字符
3.4_限定W?/a>
3.5_定位W?/a>
3.6_选择
3.7_后向引用

4._各种操作W的q算优先U?/font>
5._全部W号解释
6._部分例子
7._正则表达式匹配规?/font>

7.1_基本模式匚w
7.2_字符?/a>
7.3_定重复出现


1. 引子

  目前Q正则表辑ּ已经在很多Y件中得到q泛的应用,包括*nixQLinux, Unix{)(j)QHP{操作系l,PHPQC#QJava{开发环境,以及(qing)很多的应用Y件中Q都可以看到正则表达式的影子?/p>

  正则表达式的使用Q可以通过单的办法来实现强大的功能。ؓ(f)?jin)简单有效而又不失强大Q造成?jin)正则表辑ּ代码的难度较大,学?fn)h也不是很Ҏ(gu)Q所以需要付Z些努力才行,入门之后参照一定的参考,使用hq是比较单有效的?/p>

例子Q?span style="background-color: #00ffff;"> ^.+@.+""..+$

  q样的代码曾l多ơ把我自q吓退q。可能很多h也是被这L(fng)代码l吓跑的吧。l阅L文将让你也可以自由应用这L(fng)代码?/p>

  注意Q这里的W?部分跟前面的内容看v来似乎有些重复,目的是把前面表格里的部分重新描述?jin)一ơ,目的是让q些内容更容易理解?/p>

2. 正则表达式的历史

  正则表达式的“先”可以一直上溯至对hcȝl系l如何工作的早期研究。Warren McCulloch ?Walter Pitts q两位神l生理学家研I出一U数学方式来描述q些经|络?

  1956 q? 一位叫 Stephen Kleene 的数学家?McCulloch ?Pitts 早期工作的基上,发表?jin)一标题(sh)ؓ(f)“经|事件的表示?#8221;的论文,引入?jin)正则表辑ּ的概c(din)正则表辑ּ是用来描述他称?#8220;正则集的代数”的表辑ּQ因此采?#8220;正则表达?#8221;q个术语?/p>

  随后Q发现可以将q一工作应用于?Ken Thompson 的计搜索算法的一些早期研IӞKen Thompson ?Unix 的主要发明h。正则表辑ּ的第一个实用应用程序就?Unix 中的 qed ~辑器?/p>

  如他们所_(d)剩下的就是众所周知的历史了(jin)。从那时L(fng)至现在正则表辑ּ都是Z文本的编辑器和搜索工具中的一个重要部分?/p>

列目录时Q dir *.txt或ls *.txt中的*.txt?/span>?/span>是一个正则表辑ּ,因ؓ(f)q里*与正则式?的含义是不同的?/span>

  正则表达式是由普通字W(例如字符 a ? zQ以?qing)特D字W(UCؓ(f)元字W)(j)l成的文字模式。正则表辑ּ作ؓ(f)一个模板,某个字W模式与所搜烦(ch)的字W串q行匚w?/p>

3.2 非打印字W?/a>

字符 含义
"cx 匚w由x指明的控制字W。例如, "cM 匚w一?Control-M 或回车符。x 的值必Mؓ(f) A-Z ?a-z 之一。否则,?c 视ؓ(f)一个原义的 'c' 字符?/td>
"f 匚w一个换늬。等价于 "x0c ?"cL?/td>
"n 匚w一个换行符。等价于 "x0a ?"cJ?/td>
"r 匚w一个回车符。等价于 "x0d ?"cM?/td>
"s 匚wMI白字符Q包括空根{制表符、换늬{等。等价于 [ "f"n"r"t"v]?/td>
"S 匚wM非空白字W。等价于 [^ "f"n"r"t"v]?/td>
"t 匚w一个制表符。等价于 "x09 ?"cI?/td>
"v 匚w一个垂直制表符。等价于 "x0b ? "cK?/td>

3.3 Ҏ(gu)字符

所谓特D字W,是一些有Ҏ(gu)含义的字W,如上面说?*.txt"中的*Q简单的说就是表CZQ何字W串的意思。如果要查找文g名中有*的文Ӟ则需要对Q进行{义,卛_其前加一?。ls "*.txt。正则表辑ּ有以下特D字W?
特别字符 说明
$ 匚w输入字符串的l尾位置。如果设|了(jin) RegExp 对象?Multiline 属性,?$ 也匹? '"n' ?'"r'。要匚w $ 字符本nQ请使用 "$?/td>
( ) 标记一个子表达式的开始和l束位置。子表达式可以获取供以后使用。要匚wq些字符Q请使用 "( ? ")?/td>
* 匚w前面的子表达式零ơ或多次。要匚w * 字符Q请使用 "*?/td>
+ 匚w前面的子表达式一ơ或多次。要匚w + 字符Q请使用 "+?/td>
. 匚w除换行符 "n之外的Q何单字符。要匚w .Q请使用 "?/td>
[ 标记一个中括号表达式的开始。要匚w [Q请使用 "[?/td>
? 匚w前面的子表达式零ơ或一ơ,或指明一个非贪婪限定W。要匚w ? 字符Q请使用 "??/td>
" 下一个字W标Cؓ(f)或特D字W、或原义字符、或向后引用、或八进制{义符。例如, 'n' 匚w字符 'n'?"n' 匚w换行W。序?'""' 匚w """Q?'"(' 则匹?"("?/td>
^ 匚w输入字符串的开始位|,除非在方括号表达式中使用Q此时它表示不接受该字符集合。要匚w ^ 字符本nQ请使用 "^?/td>
{ 标记限定W表辑ּ的开始。要匚w {Q请使用 "{?/td>
| 指明两项之间的一个选择。要匚w |Q请使用 "|?/td>
  •   构造正则表辑ּ的方法和创徏数学表达式的Ҏ(gu)一栗也是用多U元字符与操作符小的表辑ּl合在一h创徏更大的表辑ּ。正则表辑ּ的组件可以是单个的字W、字W集合、字W范围、字W间的选择或者所有这些组件的Ll合?/strong>

字符 描述 * 匚w前面的子表达式零ơ或多次。例如,zo* 能匹?"z" 以及(qing) "zoo"? {h(hun)于{0,}?/td> + 匚w前面的子表达式一ơ或多次。例如,'zo+' 能匹?"zo" 以及(qing) "zoo"Q但不能匚w "z"? {h(hun)?{1,}?/td> ? 匚w前面的子表达式零ơ或一ơ。例如,"do(es)?" 可以匚w "do" ?"does" 中的"do" ? {h(hun)?{0,1}?/td> {n} n 是一个非负整数。匹配确定的 n ơ。例如,'o{2}' 不能匚w "Bob" 中的 'o'Q但是能匚w "food" 中的两个 o?/td> {n,} n 是一个非负整数。至匹配n ơ。例如,'o{2,}' 不能匚w "Bob" 中的 'o'Q但能匹? "foooood" 中的所?o?o{1,}' {h(hun)?'o+'?o{0,}' 则等价于 'o*'?/td> {n,m} m ?n 均ؓ(f)非负整数Q其中n <= m。最匹?n ơ且最多匹?m ơ。例如,"o{1,3}" 匹?"fooooood" 中的前三?o?o{0,1}' {h(hun)? 'o?'。请注意在逗号和两个数之间不能有空根{?/td>

不能对定位符使用限定W?/font>

3.6 选择

用圆括号所有选择Ҏ(gu)hQ相?c)选择之间用|分隔。但用圆括号?x)有一个副作用Q是相关的匹配会(x)被缓存,此时可用?:攑֜W一个选项前来消除q种副作用?br /> 其中?:是非捕获元之一Q还有两个非捕获元是?=?!Q这两个q有更多的含义,前者ؓ(f)正向预查Q在M开始匹配圆括号内的正则表达式模式的位置来匹配搜索字W串Q后者ؓ(f)负向预查Q在M开始不匚w该正则表辑ּ模式的位|来匚w搜烦(ch)字符丌Ӏ?

3.7 后向引用

对一个正则表辑ּ模式或部分模式两Ҏ(gu)加圆括号导致相兛_配存储到一个(f)时缓冲区中,所捕获的每个子匚w都按照在正则表达式模式中从左臛_所遇到的内容存储。存储子匚w的缓冲区~号? 1 开始,q箋(hu)~号直至最?99 个子表达式。每个缓冲区都可以?'"n' 讉KQ其?n Z个标识特定缓冲区的一位或两位十进制数?br /> 可以使用非捕获元字符 '?:', '?=', or '?!' 来忽略对相关匚w的保存?

操作W? 描述 " 转义W?/td> (), (?:), (?=), [] 圆括号和Ҏ(gu)?/td> *, +, ?, {n}, {n,}, {n,m} 限定W?/td> ^, $, "anymetacharacter 位置和顺?/td> | “?#8221;操作

5. 全部W号解释

字符 描述
" 下一个字W标Cؓ(f)一个特D字W、或一个原义字W、或一?向后引用、或一个八q制转义W。例如,'n' 匚w字符 "n"?"n' 匚w一个换行符。序?'""' 匚w """ ?""(" 则匹?"("?/td>
^ 匚w输入字符串的开始位|。如果设|了(jin) RegExp 对象?Multiline 属性,^ 也匹? '"n' ?'"r' 之后的位|?/td>
$ 匚w输入字符串的l束位置。如果设|了(jin)RegExp 对象?Multiline 属性,$ 也匹?'"n' ?'"r' 之前的位|?/td>
* 匚w前面的子表达式零ơ或多次。例如,zo* 能匹?"z" 以及(qing) "zoo"? {h(hun)于{0,}?/td>
+ 匚w前面的子表达式一ơ或多次。例如,'zo+' 能匹?"zo" 以及(qing) "zoo"Q但不能匚w "z"? {h(hun)?{1,}?/td>
? 匚w前面的子表达式零ơ或一ơ。例如,"do(es)?" 可以匚w "do" ?"does" 中的"do" ? {h(hun)?{0,1}?/td>
{n} n 是一个非负整数。匹配确定的 n ơ。例如,'o{2}' 不能匚w "Bob" 中的 'o'Q但是能匚w "food" 中的两个 o?/td>
{n,} n 是一个非负整数。至匹配n ơ。例如,'o{2,}' 不能匚w "Bob" 中的 'o'Q但能匹? "foooood" 中的所?o?o{1,}' {h(hun)?'o+'?o{0,}' 则等价于 'o*'?/td>
{n,m} m ?n 均ؓ(f)非负整数Q其中n <= m。最匹?n ơ且最多匹?m ơ。例如,"o{1,3}" 匹?"fooooood" 中的前三?o?o{0,1}' {h(hun)? 'o?'。请注意在逗号和两个数之间不能有空根{?/td>
? 当该字符紧跟在Q何一个其他限制符 (*, +, ?, {n}, {n,}, {n,m}) 后面Ӟ匚w模式是非贪婪的。非贪婪模式可能少的匹配所搜烦(ch)的字W串Q而默认的贪婪模式则尽可能多的匚w所搜烦(ch)的字W串。例如,对于字符?"oooo"Q?o+?' 匹配单?"o"Q?'o+' 匹配所?'o'?/td>
. 匚w?""n" 之外的Q何单个字W。要匚w包括 '"n' 在内的Q何字W,请用象 '[."n]' 的模式?/td>
(pattern) 匚w pattern q获取这一匚w。所获取的匹配可以从产生?Matches 集合得到Q在VBScript 中?SubMatches 集合Q在JScript 中则使用 $0…$9 属性。要匚w圆括号字W,请?'"(' ? '")'?/td>
(?:pattern) 匚w pattern 但不获取匚wl果Q也是说这是一个非获取匚wQ不q行存储供以后用。这在? "? 字符 (|) 来组合一个模式的各个部分是很有用。例如, 'industr(?:y|ies) 是一个比 'industry|industries' 更简略的表达式?/td>
(?=pattern) 正向预查Q在M匚w pattern 的字W串开始处匚w查找字符丌Ӏ这是一个非获取匚wQ也是_(d)该匹配不需要获取供以后使用。例如,'Windows (?=95|98|NT|2000)' 能匹? "Windows 2000" 中的 "Windows" Q但不能匚w "Windows 3.1" 中的 "Windows"。预查不消耗字W,也就是说Q在一个匹配发生后Q在最后一ơ匹配之后立卛_始下一ơ匹配的搜烦(ch)Q而不是从包含预查的字W之后开始?/td>
(?!pattern) 负向预查Q在M不匹?pattern 的字W串开始处匚w查找字符丌Ӏ这是一个非获取匚wQ也是_(d)该匹配不需要获取供以后使用。例?Windows (?!95|98|NT|2000)' 能匹? "Windows 3.1" 中的 "Windows"Q但不能匚w "Windows 2000" 中的 "Windows"。预查不消耗字W,也就是说Q在一个匹配发生后Q在最后一ơ匹配之后立卛_始下一ơ匹配的搜烦(ch)Q而不是从包含预查的字W之后开?/td>
x|y 匚w x ?y。例如,'z|food' 能匹?"z" ?"food"?(z|f)ood' 则匹? "zood" ?"food"?/td>
[xyz] 字符集合。匹配所包含的Q意一个字W。例如, '[abc]' 可以匚w "plain" 中的 'a'?/td>
[^xyz] 负值字W集合。匹配未包含的Q意字W。例如, '[^abc]' 可以匚w "plain" 中的'p'?/td>
[a-z] 字符范围。匹配指定范围内的Q意字W。例如,'[a-z]' 可以匚w 'a' ?'z' 范围内的L写字母字符?/td>
[^a-z] 负值字W范围。匹配Q何不在指定范围内的Q意字W。例如,'[^a-z]' 可以匚wM不在 'a' ? 'z' 范围内的L字符?/td>
"b 匚w一个单词边界,也就是指单词和空格间的位|。例如, 'er"b' 可以匚w"never" 中的 'er'Q但不能匚w "verb" 中的 'er'?/td>
"B 匚w非单词边界?er"B' 能匹?"verb" 中的 'er'Q但不能匚w "never" 中的 'er'?/td>
"cx 匚w?x 指明的控制字W。例如, "cM 匚w一?Control-M 或回车符。x 的值必Mؓ(f) A-Z ?a-z 之一。否则,?c 视ؓ(f)一个原义的 'c' 字符?/td>
"d 匚w一个数字字W。等价于 [0-9]?/td>
"D 匚w一个非数字字符。等价于 [^0-9]?/td>
"f 匚w一个换늬。等价于 "x0c ?"cL?/td>
"n 匚w一个换行符。等价于 "x0a ?"cJ?/td>
"r 匚w一个回车符。等价于 "x0d ?"cM?/td>
"s 匚wMI白字符Q包括空根{制表符、换늬{等。等价于 [ "f"n"r"t"v]?/td>
"S 匚wM非空白字W。等价于 [^ "f"n"r"t"v]?/td>
"t 匚w一个制表符。等价于 "x09 ?"cI?/td>
"v 匚w一个垂直制表符。等价于 "x0b ?"cK?/td>
"w 匚w包括下划U的M单词字符。等价于'[A-Za-z0-9_]'?/td>
"W 匚wM非单词字W。等价于 '[^A-Za-z0-9_]'?/td>
"xn 匚w nQ其?n 为十六进制{义倹{十六进制{义值必Mؓ(f)定的两个数字长。例如,'"x41' 匚w "A"?"x041' 则等价于 '"x04' & "1"。正则表辑ּ中可以?ASCII ~码?
"num 匚w numQ其?num 是一个正整数。对所获取的匹配的引用。例如,'(.)"1' 匚w两个q箋(hu)的相同字W?/td>
"n 标识一个八q制转义值或一个向后引用。如?"n 之前臛_ n 个获取的子表辑ּQ则 n 为向后引用。否则,如果 n 为八q制数字 (0-7)Q则 n Z个八q制转义倹{?/td>
"nm 标识一个八q制转义值或一个向后引用。如?"nm 之前臛_?nm 个获得子表达式,?nm 为向后引用。如?"nm 之前臛_?n 个获取,?n Z个后跟文?m 的向后引用。如果前面的条g都不满Q若 n ?m 均ؓ(f)八进制数?(0-7)Q则 "nm 匹配八q制转义?nm?/td>
"nml 如果 n 为八q制数字 (0-3)Q且 m ?l 均ؓ(f)八进制数?(0-7)Q则匚w八进制{义? nml?/td>
"un 匚w nQ其?n 是一个用四个十六q制数字表示?Unicode 字符。例如, "u00A9 匚w版权W号 (?)?/td>

6. 部分例子

正则表达?/th> 说明
/"b([a-z]+) "1"b/gi 一个单词连l出现的位置
/("w+):"/"/([^/:]+)(:"d*)?([^# ]*)/ 一个URL解析为协议、域、端口及(qing)相对路径
/^(?:Chapter|Section) [1-9][0-9]{0,1}$/ 定位章节的位|?/td>
/[-a-z]/ A至z?6个字母再加一?受?/td>
/ter"b/ 可匹配chapterQ而不能terminal
/"Bapt/ 可匹配chapterQ而不能aptitude
/Windows(?=95 |98 |NT )/ 可匹配Windows95或Windows98或WindowsNT,当找C个匹配后Q从Windows后面开始进行下一ơ的(g)索匹配?/td>

7.1 基本模式匚w

一切从最基本的开始。模式,是正规表辑ּ最基本的元素,它们是一l描q字W串特征的字W。模式可以很单,由普通的字符串组成,也可以非常复杂,往往用特D的字符表示一个范围内的字W、重复出玎ͼ或表CZ下文。例如:(x)

^once

  q个模式包含一个特D的字符^Q表C模式只匹配那些以once开头的字符丌Ӏ例如该模式与字W串"once upon a time"匚wQ与"There once was a man from NewYork"不匹配。正如如^W号表示开头一P$W号用来匚w那些以给定模式结字符丌Ӏ?/p>

bucket$

  q个模式?Who kept all of this cash in a bucket"匚wQ与"buckets"不匹配。字W^?同时使用Ӟ表示_匚wQ字W串与模式一P(j)。例如:(x)

^bucket$

  只匹配字W串"bucket"。如果一个模式不包括^?Q那么它与Q何包含该模式的字W串匚w。例如:(x)模式

once

与字W串

There once was a man from NewYork
Who kept all of his cash in a bucket.

是匹配的?br />
在该模式中的字母(o-n-c-e)是字面的字符Q也是_(d)他们表示该字母本w,数字也是一L(fng)。其他一些稍微复杂的字符Q如标点W号和白字符Q空根{制表符{)(j)Q要用到转义序列。所有的转义序列都用反斜?")打头。制表符的{义序列是Q?t。所以如果我们要(g)一个字W串是否以制表符开_(d)可以用这个模式:(x)

^"t

cM的,?n表示“新行”Q?r表示回R。其他的Ҏ(gu)W号Q可以用在前面加上反斜杠Q如反斜杠本w用""表示Q句??.表示Q以此类推?br />
[ "f"r"t"n] //匚w所有的白字W?

同样的,q些也只表示一个字W,q是一个非帔R要的。如果要匚w一个由一个小写字母和一位数字组成的字符Ԍ比如"z2"?t6"?g7"Q但不是"ab2"?r2d3" ?b52"的话Q用q个模式Q?/p>

^[a-z][0-9]$

管[a-z]代表26个字母的范围Q但在这里它只能与第一个字W是写字母的字W串匚w?br />
前面曄提到^表示字符串的开_(d)但它q有另外一个含义。当在一l方括号里用^是,它表C?#8220;?#8221;?#8220;排除”的意思,常常用来剔除某个字符。还用前面的例子Q我们要求第一个字W不能是数字Q?/p>

^[^0-9][0-9]$

q个模式?&5"?g7"?-2"是匹配的Q但?12"?66"是不匚w的。下面是几个排除特定字符的例子:(x)

[^a-z] //除了(jin)写字母以外的所有字W?
[^"""/"^] //除了(jin)(")(/)(^)之外的所有字W?
[^"""'] //除了(jin)双引?")和单引号(')之外的所有字W?

Ҏ(gu)字符"." (点,句号)在正规表辑ּ中用来表C除?#8220;新行”之外的所有字W。所以模?^.5$"与Q何两个字W的、以数字5l尾和以其他?#8220;新行”字符开头的字符串匹配。模?."可以匚wM字符Ԍ除了(jin)IZ和只包括一?#8220;新行”的字W串?br />
PHP的正规表辑ּ有一些内|的通用字符,列表如下Q?/p>

字符?含义
[[:alpha:]] M字母
[[:digit:]] M数字
[[:alnum:]] M字母和数?
[[:space:]] M白字W?
[[:upper:]] M大写字母
[[:lower:]] M写字母
[[:punct:]] M标点W号
[[:xdigit:]] M16q制的数字,相当于[0-9a-fA-F]

7.3 定重复出现

到现在ؓ(f)止,你已l知道如何去匚w一个字母或数字Q但更多的情况下Q可能要匚w一个单词或一l数字。一个单词有若干个字母组成,一l数字有若干个单数组成。跟在字W或字符后面的花括?{})用来定前面的内容的重复出现的次数?

字符?含义
^[a-zA-Z_]$ 所有的字母和下划线
^[[:alpha:]]{3}$ 所有的3个字母的单词
^a$ 字母a
^a{4}$ aaaa
^a{2,4}$ aa,aaa或aaaa
^a{1,3}$ a,aa或aaa
^a{2,}$ 包含多于两个a的字W串
^a{2,} 如:(x)aardvark和aaabQ但apple不行
a{2,} 如:(x)baad和aaaQ但Nantucket不行
"t{2} 两个制表W?
.{2} 所有的两个字符

q些例子描述?jin)花括号的三U不同的用法。一个数字,{x}的意思是“前面的字W或字符只出现x?#8221;Q一个数字加逗号Q{x,}的意思是“前面的内容出现x或更多的ơ数”Q两个用逗号分隔的数字,{x,y}表示“前面的内容至出现xơ,但不过y?#8221;。我们可以把模式扩展到更多的单词或数字:(x)

^[a-zA-Z0-9_]{1,}$ //所有包含一个以上的字母、数字或下划U的字符?
^[0-9]{1,}$ //所有的正数
^"-{0,1}[0-9]{1,}$ //所有的整数
^"-{0,1}[0-9]{0,}".{0,1}[0-9]{0,}$ //所有的数

最后一个例子不太好理解Q是吗?q么看吧Q与所有以一个可选的负号("-{0,1})开?^)、跟着0个或更多的数?[0-9]{0,})、和一个可选的数?".{0,1})再跟?个或多个数字([0-9]{0,})Qƈ且没有其他Q何东?$)。下面你知道能够用的更ؓ(f)单的Ҏ(gu)?br />
Ҏ(gu)字符"?"与{0,1}是相{的Q它们都代表着Q?#8220;0个或1个前面的内容”?#8220;前面的内Ҏ(gu)可选的”。所以刚才的例子可以化ؓ(f)Q?/p>

^"-?[0-9]{0,}".?[0-9]{0,}$

Ҏ(gu)字符"*"与{0,}是相{的Q它们都代表着“0个或多个前面的内?#8221;。最后,字符"+"? {1,}是相{的Q表C?#8220;1个或多个前面的内?#8221;Q所以上面的4个例子可以写成:(x)

^[a-zA-Z0-9_]+$ //所有包含一个以上的字母、数字或下划U的字符?
^[0-9]+$ //所有的正数
^"-?[0-9]+$ //所有的整数
^"-?[0-9]*".?[0-9]*$ //所有的数

当然qƈ不能从技术上降低正规表达式的复杂性,但可以它们更容易阅诅R?/p>

参考文献:(x)
JScript ?nbsp;VBScript 正则表达?/a>

微YMSDN上的例子(英文)Q?/p>
Scanning for HREFS
Provides an example that searches an input string and prints out all the href="..." values and their locations in the string.
Changing Date Formats
Provides an example that replaces dates of the form mm/dd/yy with dates of the form dd-mm-yy.
Extracting URL Information
Provides an example that extracts a protocol and port number from a string containing a URL. For example, "http://www.contoso.com:8080/letters/readme.html" returns "http:8080".
Cleaning an Input String
provides an example that strips invalid non-alphanumeric characters from a string.
Confirming Valid E-Mail Format
Provides an example that you can use to verify that a string is in valid e-mail format


lqx 2008-11-24 14:32 发表评论
]]>JavaScript中的正则表达?/title><link>http://www.tkk7.com/lqxue/archive/2008/11/24/242263.html</link><dc:creator>lqx</dc:creator><author>lqx</author><pubDate>Mon, 24 Nov 2008 06:31:00 GMT</pubDate><guid>http://www.tkk7.com/lqxue/archive/2008/11/24/242263.html</guid><wfw:comment>http://www.tkk7.com/lqxue/comments/242263.html</wfw:comment><comments>http://www.tkk7.com/lqxue/archive/2008/11/24/242263.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/lqxue/comments/commentRss/242263.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/lqxue/services/trackbacks/242263.html</trackback:ping><description><![CDATA[<font id="zoom">正则表达?regular expression)对象包含一个正则表辑ּ模式(pattern)。它h用正则表辑ּ模式d配或代替一个串(string)中特定字W?或字W集?的属?properties)和方?methods)? 要ؓ(f)一个单独的正则表达式添加属?可以使用正则表达式构造函?constructor function)Q无Z时被调用的预讄的正则表辑ּ拥有?rn)态的属?the predefined RegExp object has static properties that are set whenever any regular expression is used, 我不知道我翻得对不对Q将原文列出Q请自行译)? </font> <ul><font id="zoom"> <li>创徏Q?<br /> 一个文本格式或正则表达式构造函?<br /> 文本格式Q?/pattern/flags <br /> 正则表达式构造函敎ͼ(x) new RegExp("pattern"[,"flags"]); </li> <li>参数说明Q?<br /> pattern -- 一个正则表辑ּ文本 <br /> flags -- 如果存在Q将是以下|(x) <br /> g: 全局匚w <br /> i: 忽略大小?<br /> gi: 以上l合</li> </font></ul> <p><font id="zoom">[<font color="#ff0000">注意</font>] <em>文本格式的参C用引P而在用构造函数时的参数需要引受如Q?ab+c/i new RegExp("ab+c","i")是实CL(fng)功能。在构造函CQ一些特D字W需要进行{?在特D字W前?"")。如Qre = new RegExp("""w+") </em></font></p> <p><font id="zoom">正则表达式中的特D字W?</font></p> <table width="90%" bgcolor="#000000" cellpadding="1" cellspacing="0"> <tbody> <tr> <td> <table width="100%" bgcolor="#ffffff" cellpadding="3" cellspacing="1"> <tbody> <tr align="center" bgcolor="#ccccff"> <td>字符 </td> <td>含意 </td> </tr> <tr bgcolor="#dfdfdf"> <td>"</td> <td> <p>做ؓ(f)转意Q即通常?""后面的字W不按原来意义解释,?b/匚w字符"b"Q当b前面加了(jin)反斜杆后/"b/Q{意ؓ(f)匚w一个单词的边界?<br /> -? <br /> Ҏ(gu)则表辑ּ功能字符的还原,?*"匚w它前面元字符0ơ或多次Q?a*/匹配a,aa,aaaQ加?""后,/a"*/只匚w"a*"? </p> </td> </tr> <tr> <td>^ </td> <td>匚w一个输入或一行的开_(d)/^a/匚w"an A"Q而不匚w"An a" </td> </tr> <tr bgcolor="#dfdfdf"> <td>$ </td> <td>匚w一个输入或一行的l尾Q?a$/匚w"An a"Q而不匚w"an A" </td> </tr> <tr> <td>* </td> <td>匚w前面元字W?ơ或多次Q?ba*/匹配b,ba,baa,baaa </td> </tr> <tr bgcolor="#dfdfdf"> <td>+ </td> <td>匚w前面元字W?ơ或多次Q?ba*/匹配ba,baa,baaa </td> </tr> <tr> <td>? </td> <td>匚w前面元字W?ơ或1ơ,/ba*/匹配b,ba </td> </tr> <tr bgcolor="#dfdfdf"> <td>(x) </td> <td>匚wx保存x在名?1...$9的变量中 </td> </tr> <tr> <td>x|y </td> <td>匚wx或y </td> </tr> <tr bgcolor="#dfdfdf"> <td>{n} </td> <td>_匚wn?</td> </tr> <tr> <td>{n,} </td> <td>匚wnơ以?</td> </tr> <tr bgcolor="#dfdfdf"> <td>{n,m} </td> <td>匚wn-m?</td> </tr> <tr> <td>[xyz] </td> <td>字符?character set)Q匹配这个集合中的Q一一个字W?或元字符) </td> </tr> <tr bgcolor="#dfdfdf"> <td>[^xyz] </td> <td>不匹配这个集合中的Q何一个字W?</td> </tr> <tr> <td>["b] </td> <td>匚w一个退格符</td> </tr> <tr bgcolor="#dfdfdf"> <td>"b </td> <td>匚w一个单词的边界 </td> </tr> <tr> <td>"B </td> <td>匚w一个单词的非边?/td> </tr> <tr bgcolor="#dfdfdf"> <td>"cX </td> <td>q儿QX是一个控制符Q?"cM/匚wCtrl-M </td> </tr> <tr> <td>"d </td> <td>匚w一个字数字W,/"d/ = /[0-9]/ </td> </tr> <tr bgcolor="#dfdfdf"> <td>"D </td> <td>匚w一个非字数字符Q?"D/ = /[^0-9]/ </td> </tr> <tr> <td>"n </td> <td>匚w一个换行符 </td> </tr> <tr bgcolor="#dfdfdf"> <td>"r </td> <td>匚w一个回车符 </td> </tr> <tr> <td>"s </td> <td>匚w一个空白字W,包括"n,"r,"f,"t,"v{?</td> </tr> <tr bgcolor="#dfdfdf"> <td>"S </td> <td>匚w一个非I白字符Q等?[^"n"f"r"t"v]/ </td> </tr> <tr> <td>"t </td> <td>匚w一个制表符 </td> </tr> <tr bgcolor="#dfdfdf"> <td>"v </td> <td>匚w一个重直制表符 </td> </tr> <tr> <td>"w </td> <td>匚w一个可以组成单词的字符(alphanumericQ这是我的意译,含数?Q包括下划线Q如["w]匚w"$5.98"中的5Q等于[a-zA-Z0-9] </td> </tr> <tr bgcolor="#dfdfdf"> <td>"W </td> <td>匚w一个不可以l成单词的字W,如["W]匚w"$5.98"中的$Q等于[^a-zA-Z0-9]?/td> </tr> </tbody> </table> </td> </tr> </tbody> </table> <font id="zoom"><br /> </font> <p><font id="zoom">说了(jin)q么多了(jin)Q我们来看一些正则表辑ּ的实际应用的例子Q?</font></p> <blockquote style="margin-right: 0px;"> <p><font id="zoom">E-mail地址验证: <br />  function test_email(strEmail) { <br />   var myReg = /^[_a-z0-9]+@([_a-z0-9]+".)+[a-z0-9]{2,3}$/; <br />   if(myReg.test(strEmail)) return true; <br />   return false; <br />  } <br /> HTML代码的屏?<br />  function mask_HTMLCode(strInput) { <br />    var myReg = /<("w+)>/; <br />    return strInput.replace(myReg, "&lt;$1&gt;"); <br />  }<br /> </font></p> <p><br /> </p> <p><font><strong>正则表达式对象的属性及(qing)Ҏ(gu)</strong> <br /> 预定义的正则表达式拥有有以下?rn)态属性:(x)input, multiline, lastMatch, lastParen, leftContext, rightContext?1?9。其中input和multiline可以预设|。其他属性的值在执行qexec或testҎ(gu)后被Ҏ(gu)不同条g赋以不同的倹{许多属性同时拥有长和短(perl风格)的两个名字,q且Q这两个名字指向同一个倹{?JavaScript模拟perl的正则表辑ּ) <br /> 正则表达式对象的属? <table width="90%" bgcolor="#000000" cellpadding="1" cellspacing="0"> <tbody> <tr> <td> <table width="100%" bgcolor="#ffffff" cellpadding="1" cellspacing="1"> <tbody> <tr valign="middle" bgcolor="#ccccff"> <td>属?/td> <td>含义</td> </tr> <tr bgcolor="#dfdfdf"> <td>$1...$9</td> <td>如果??存在Q是匚w到的子串 </td> </tr> <tr> <td>$_</td> <td>参见input </td> </tr> <tr bgcolor="#dfdfdf"> <td>$*</td> <td>参见multiline </td> </tr> <tr> <td>$&</td> <td>参见lastMatch </td> </tr> <tr bgcolor="#dfdfdf"> <td>$+</td> <td>参见lastParen </td> </tr> <tr> <td>$`</td> <td>参见leftContext </td> </tr> <tr bgcolor="#dfdfdf"> <td>$'         </td> <td>参见rightContext </td> </tr> <tr> <td>constructor    </td> <td>创徏一个对象的一个特D的函数原型 </td> </tr> <tr bgcolor="#dfdfdf"> <td>global       </td> <td>是否在整个串中匹?bool? </td> </tr> <tr> <td>ignoreCase    </td> <td>匚w时是否忽略大写(bool? </td> </tr> <tr bgcolor="#dfdfdf"> <td>input       </td> <td>被匹配的?</td> </tr> <tr> <td>lastIndex     </td> <td>最后一ơ匹配的索引 </td> </tr> <tr bgcolor="#dfdfdf"> <td>lastParen     </td> <td>最后一个括hh的子?</td> </tr> <tr> <td>leftContext    </td> <td>最q一ơ匹配以左的子串 </td> </tr> <tr bgcolor="#dfdfdf"> <td>multiline     </td> <td>是否q行多行匚w(bool? </td> </tr> <tr> <td>prototype     </td> <td>允许附加属性给对象 </td> </tr> <tr bgcolor="#dfdfdf"> <td>rightContext   </td> <td>最q一ơ匹配以右的子串 </td> </tr> <tr> <td>source       </td> <td>正则表达式模?</td> </tr> <tr bgcolor="#dfdfdf"> <td>lastIndex     </td> <td>最后一ơ匹配的索引 </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> <strong><br /> 正则表达式对象的Ҏ(gu) </strong> <table width="90%" bgcolor="#000000" cellpadding="1" cellspacing="0"> <tbody> <tr> <td> <table width="100%" bgcolor="#ffffff" cellpadding="1" cellspacing="1"> <tbody> <tr align="center" bgcolor="#ccccff"> <td>Ҏ(gu)</td> <td>含义</td> </tr> <tr bgcolor="#dfdfdf"> <td>compile      </td> <td>正则表达式比?</td> </tr> <tr> <td>exec       </td> <td>执行查找 </td> </tr> <tr bgcolor="#dfdfdf"> <td>test       </td> <td>q行匚w </td> </tr> <tr> <td>toSource     </td> <td>q回特定对象的定?literal representing)Q其值可用来创徏一个新的对象。重载Object.toSourceҎ(gu)得到的? </td> </tr> <tr bgcolor="#dfdfdf"> <td>toString     </td> <td>q回特定对象的串。重载Object.toStringҎ(gu)得到的?</td> </tr> <tr> <td>valueOf      </td> <td>q回特定对象的原始倹{重载Object.valueOfҎ(gu)得到</td> </tr> </tbody> </table> </td> </tr> </tbody> </table> <strong>例子 <br /> <script language = "JavaScript"> <br /> var myReg = /(w+)s(w+)/; <br /> var str  = "John Smith"; <br /> var newstr = str.replace(myReg, "$2, $1"); <br /> document.write(newstr); <br /> </script> <br /> 输?Smith, John"</strong></font></p> <p><br /> </p> <p>〓简介?br /> 字符意义Q对于字W,通常表示按字面意义,指出接着的字Wؓ(f)Ҏ(gu)字符Q不作解释?<br /> 例如Q?b/匚w字符'b',通过在b 前面加一个反斜杠Q也是/b/Q则该字W变成特D字W,表示匚w一个单词的分界Uѝ或者:(x)对于几个字符Q通常说明是特D的Q指出紧接着的字W不是特D的Q而应该按字面解释。例如:(x)*是一个特D字W,匚wL个字W?包括0个字W?Q例如:(x)/a*/意味匚w0个或多个a。ؓ(f)?jin)匹配字面上?Q在a前面加一个反斜杠Q例如:(x)/a*/匚w'a*'?/p> <p>〓正文?br /> 字符 <br /> 意义Q对于字W,通常表示按字面意义,指出接着的字Wؓ(f)Ҏ(gu)字符Q不作解释?<br /> 例如Q?b/匚w字符'b',通过在b 前面加一个反斜杠Q也是/b/Q则该字W变成特D字W,表示 <br /> 匚w一个单词的分界Uѝ?<br /> 或者:(x) <br /> 对于几个字符Q通常说明是特D的Q指出紧接着的字W不是特D的Q而应该按字面解释? <br /> 例如Q?是一个特D字W,匚wL个字W?包括0个字W?Q例如:(x)/a*/意味匚w0个或多个a? <br /> Z(jin)匚w字面上的*Q在a前面加一个反斜杠Q例如:(x)/a*/匚w'a*'?</p> <p>字符^ <br /> 意义Q表C匹配的字符必须在最前边?<br /> 例如Q?^A/不匹?an A,"中的'A'Q但匚w"An A."中最前面?A'?</p> <p>字符$ <br /> 意义Q与^cMQ匹配最末的字符?<br /> 例如Q?t$/不匹?eater"中的't'Q但匚w"eat"中的't'?</p> <p>字符* <br /> 意义Q匹?前面的字W?ơ或nơ?<br /> 例如:/bo*/匚w"A ghost booooed"中的'boooo'?A bird warbled"中的'b'Q但不匹?A goat g <br /> runted"中的M字符?</p> <p>字符+ <br /> 意义Q匹?号前面的字符1ơ或nơ。等价于{1,}? <br /> 例如Q?a+/匚w"candy"中的'a'?caaaaaaandy."中的所?a'?</p> <p>字符? <br /> 意义Q匹?前面的字W?ơ或1ơ?<br /> 例如Q?e?le?/匚w"angel"中的'el'?angle."中的'le'?</p> <p>字符. <br /> 意义Q?数?匚w除换行符外的所有单个的字符?<br /> 例如Q?.n/匚w"nay, an apple is on the tree"中的'an'?on'Q但不匹?nay'?</p> <p><br /> 字符(x) <br /> 意义Q匹?x'q记录匹配的倹{?<br /> 例如Q?(foo)/匚w和记?foo bar."中的'foo'。匹配子串能被结果数l中的素[1], ..., [n] q?<br /> 回,或被RegExp对象的属?1, ..., $9q回?</p> <p>字符x|y <br /> 意义Q匹?x'或?y'?<br /> 例如Q?green|red/匚w"green apple"中的'green'?red apple."中的'red'?</p> <p>字符{n} <br /> 意义Q这里的n是一个正整数。匹配前面的n个字W?<br /> 例如Q?a{2}/不匹?candy,"中的'a'Q但匚w"caandy," 中的所?a'?caaandy."中前面的两个 <br /> 'a'?</p> <p>字符{n,} <br /> 意义Q这里的n是一个正整数。匹配至n个前面的字符? <br /> 例如Q?a{2,}不匹?candy"中的'a'Q但匚w"caandy"中的所?a'?caaaaaaandy."中的所?a' </p> <p>字符{n,m} <br /> 意义Q这里的n和m都是正整数。匹配至n个最多m个前面的字符? <br /> 例如Q?a{1,3}/不匹?cndy"中的M字符Q但匚w "candy,"中的'a'Q?caandy," 中的前面两个 <br /> 'a'?caaaaaaandy"中前面的三个'a'Q注意:(x)即"caaaaaaandy" 中有很多?a'Q但只匹配前面的? <br /> ?a'?aaa"?</p> <p>字符[xyz] <br /> 意义Q一字符列表Q匹配列Z的Q一字符。你可以通过q字W?指出一个字W范围? <br /> 例如Q[abcd]跟[a-c]一栗它们匹?brisket"中的'b'?ache"中的'c'?</p> <p>字符[^xyz] <br /> 意义Q一字符补集Q也是_(d)它匹配除?jin)列出的字符外的所有东ѝ?你可以用连字符-指出一 <br /> 字符范围? <br /> 例如Q[^abc]和[^a-c]{h(hun)Q它们最早匹?brisket"中的'r'?chop."中的'h'?</p> <p>字符[b] <br /> 意义Q匹配一个空?不要与bh) </p> <p>字符b <br /> 意义Q匹配一个单词的分界U,比如一个空?不要与[b]h) <br /> 例如Q?bnw/匚w"noonday"中的'no'Q?wyb/匚w"possibly yesterday."中的'ly'?</p> <p>字符B <br /> 意义Q匹配一个单词的非分界线 <br /> 例如Q?wBn/匚w"noonday"中的'on'Q?yBw/匚w"possibly yesterday."中的'ye'?</p> <p>字符cX <br /> 意义Q这里的X是一个控制字W。匹配一个字W串的控制字W?<br /> 例如Q?cM/匚w一个字W串中的control-M?</p> <p>字符d <br /> 意义Q匹配一个数字,{h(hun)于[0-9]?<br /> 例如Q?d/?[0-9]/匚w"B2 is the suite number."中的'2'?</p> <p>字符D <br /> 意义Q匹配Q何的非数字,{h(hun)于[^0-9]?<br /> 例如Q?D/?[^0-9]/匚w"B2 is the suite number."中的'B'?</p> <p>字符f <br /> 意义Q匹配一个表单符 </p> <p>字符n <br /> 意义Q匹配一个换行符 </p> <p>字符r <br /> 意义Q匹配一个回车符 </p> <p>字符s <br /> 意义Q匹配一个单个whiteI格W,包括I格QtabQform feedQ换行符Q等价于[ fnrtv]? <br /> 例如Q?sw*/匚w"foo bar."中的' bar'?</p> <p>字符S <br /> 意义Q匹配除whiteI格W以外的一个单个的字符Q等价于[^ fnrtv]?<br /> 例如Q?S/w*匚w"foo bar."中的'foo'?</p> <p>字符t <br /> 意义Q匹配一个制表符 </p> <p>字符v <br /> 意义Q匹配一个顶头制表符 </p> <p>字符w <br /> 意义Q匹配所有的数字和字母以?qing)下划线Q等价于[A-Za-z0-9_]? <br /> 例如Q?w/匚w"apple,"中的'a'Q?$5.28,"中的'5'?3D."中的'3'?</p> <p>字符W <br /> 意义Q匹配除数字、字母外?qing)下划线外的其它字符Q等价于[^A-Za-z0-9_]? <br /> 例如Q?W/或?[^$A-Za-z0-9_]/匚w"50%."中的'%'?</p> <p>字符n <br /> 意义Q这里的n是一个正整数。匹配一个正则表辑ּ的最后一个子串的n的?计数左圆括号)?</p> <p>例如Q?apple(,)sorange1/匚w"apple, orange, cherry, peach."中的'apple, orange'Q下? <br /> 有一个更加完整的例子?<br /> 注意Q如果左圆括号中的数字比n指定的数字还,则n取下一行的八进制escape作ؓ(f)描述?</p> <p>字符ooctal和xhex <br /> 意义Q这里的ooctal是一个八q制的escape|而xhex是一个十六进制的escape|允许在一个正则表辑ּ中嵌入ASCII码?/p> </blockquote> <img src ="http://www.tkk7.com/lqxue/aggbug/242263.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/lqxue/" target="_blank">lqx</a> 2008-11-24 14:31 <a href="http://www.tkk7.com/lqxue/archive/2008/11/24/242263.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>js压羃http://www.tkk7.com/lqxue/archive/2008/11/04/238669.htmllqxlqxTue, 04 Nov 2008 09:53:00 GMThttp://www.tkk7.com/lqxue/archive/2008/11/04/238669.htmlhttp://www.tkk7.com/lqxue/comments/238669.htmlhttp://www.tkk7.com/lqxue/archive/2008/11/04/238669.html#Feedback0http://www.tkk7.com/lqxue/comments/commentRss/238669.htmlhttp://www.tkk7.com/lqxue/services/trackbacks/238669.html压羃不仅仅可以提高用L(fng)下蝲速度Q同时还可以加密代码Q下面说下一个常用的js压羃Ҏ(gu)Q?/p>

首先使用dojo的工具shrinksafe(http://shrinksafe.dojotoolkit.org/)压羃一?dojo的这? 工具?x)去掉注释,他的压羃不是单的替换变量Q而是利用?jin)mozilla的一个工?对js解析后才压羃Q确保压~后的代码不?x)出错?/p>

dojo压羃后,q不?x)减太多,下一步可以用http://javascriptcompressor.com/q个站点q行更高层次的压~?可惜只能登陆q个站点再压~,只能你的js代码复制的他的文本框Q然后等他的压羃输出

l过q?步,你的js?x)变得既安?文g又小

lqx 2008-11-04 17:53 发表评论
]]>
firefox 3 call Components.classeshttp://www.tkk7.com/lqxue/archive/2008/09/18/229665.htmllqxlqxThu, 18 Sep 2008 05:16:00 GMThttp://www.tkk7.com/lqxue/archive/2008/09/18/229665.htmlhttp://www.tkk7.com/lqxue/comments/229665.htmlhttp://www.tkk7.com/lqxue/archive/2008/09/18/229665.html#Feedback0http://www.tkk7.com/lqxue/comments/commentRss/229665.htmlhttp://www.tkk7.com/lqxue/services/trackbacks/229665.html <script>
    netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
    var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
        prefs.setBoolPref("dom.allow_scripts_to_close_windows", true);
</script>


lqx 2008-09-18 13:16 发表评论
]]>
firefox extension ?call click 事ghttp://www.tkk7.com/lqxue/archive/2008/09/17/229407.htmllqxlqxWed, 17 Sep 2008 05:44:00 GMThttp://www.tkk7.com/lqxue/archive/2008/09/17/229407.htmlhttp://www.tkk7.com/lqxue/comments/229407.htmlhttp://www.tkk7.com/lqxue/archive/2008/09/17/229407.html#Feedback0http://www.tkk7.com/lqxue/comments/commentRss/229407.htmlhttp://www.tkk7.com/lqxue/services/trackbacks/229407.html 在chomal.manifest里如下设定,注意黄色部分Q很关键
content     sample    chrome/content/  xpcnativewrappers=no
overlay chrome://browser/content/browser.xul chrome://sample/content/sample.xul

调用方式Q?br /> window.content.document.getElementById('sssddd').onclick();


参考如下连?br />
http://developer.mozilla.org/En/Safely_accessing_content_DOM_from_chrome

xpcnativewrappers

http://developer.mozilla.org/en/Chrome_Registration


lqx 2008-09-17 13:44 发表评论
]]>
div 底端寚whttp://www.tkk7.com/lqxue/archive/2008/09/01/226057.htmllqxlqxMon, 01 Sep 2008 05:13:00 GMThttp://www.tkk7.com/lqxue/archive/2008/09/01/226057.htmlhttp://www.tkk7.com/lqxue/comments/226057.htmlhttp://www.tkk7.com/lqxue/archive/2008/09/01/226057.html#Feedback0http://www.tkk7.com/lqxue/comments/commentRss/226057.htmlhttp://www.tkk7.com/lqxue/services/trackbacks/226057.html<style type="text/css" media="all">
div,img
{margin: 0;padding: 0;border: 0;}


#content
{width: 303px;height: 404px;background: #F63;color: #000;font: 12px Arial,Helvetica,sans-serif;position: relative;}

#content div
{position: absolute;left: 0;bottom: 0;}
</style>
</head>
<body>
<div id="content">
<div>底端寚w </div>
</div>

lqx 2008-09-01 13:13 发表评论
]]>
http://www.w3school.com.cnhttp://www.tkk7.com/lqxue/archive/2008/07/02/212103.htmllqxlqxWed, 02 Jul 2008 05:25:00 GMThttp://www.tkk7.com/lqxue/archive/2008/07/02/212103.htmlhttp://www.tkk7.com/lqxue/comments/212103.htmlhttp://www.tkk7.com/lqxue/archive/2008/07/02/212103.html#Feedback0http://www.tkk7.com/lqxue/comments/commentRss/212103.htmlhttp://www.tkk7.com/lqxue/services/trackbacks/212103.html http://www.w3school.com.cn

lqx 2008-07-02 13:25 发表评论
]]>
[收藏]l说HTML元素的ID和Name属性的区别http://www.tkk7.com/lqxue/archive/2008/06/03/205659.htmllqxlqxTue, 03 Jun 2008 13:46:00 GMThttp://www.tkk7.com/lqxue/archive/2008/06/03/205659.htmlhttp://www.tkk7.com/lqxue/comments/205659.htmlhttp://www.tkk7.com/lqxue/archive/2008/06/03/205659.html#Feedback0http://www.tkk7.com/lqxue/comments/commentRss/205659.htmlhttp://www.tkk7.com/lqxue/services/trackbacks/205659.html几乎每个做过Web开发的人都问过Q到底元素的ID和Name有什么区别阿Qؓ(f)什么有?jin)IDq要有Name?而同h们也可以得到最classical的答案:(x)ID像是一个h的n份证L(fng)Q而Name像是他的名字,ID昄是唯一的,而Name是可以重复的?

  上周我也遇到?jin)ID和Name的问题,在页面里输入?jin)一个input type="hidden"Q只写了(jin)一个ID='SliceInfo'Q赋值后submitQ在后台用Request.Params["SliceInfo"]却怎么也去不到倹{后来恍然大(zhn)因该用Name来标C,于是在input里加?jin)个Name='SliceInfo'Q就一切ok?jin)?/p>

  W一D里对于ID和Name的解{说的太W统?jin),当然那个解释对于ID来说是完全对的,它就是Client端HTML元素的Identity。而Name其实要复杂的多,因ؓ(f)Name有很多种的用途,所以它q不能完全由ID来代替,从而将其取消掉?/p>

  具体用途有Q?/p>

  用?:  作ؓ(f)可与服务器交互数据的HTML元素的服务器端的标示Q比如input、select、textarea、和button{。我们可以在服务器端Ҏ(gu)其Name通过Request.Params取得元素提交的倹{?
  用?:  HTML元素I(yng)nput type='radio'分组Q我们知道radio button控g在同一个分l类Qcheck操作是mutex的,同一旉只能选中一个radioQ这个分l就是根据相同的Name属性来实现的?/p>

  用?:  建立面中的锚点Q我们知?a >link是获得一个页面超U链接,如果不用href属性,而改用NameQ如Q?a name="PageBottom">Q我们就获得?jin)一个页面锚炏V?/p>

  用?:  作ؓ(f)对象的IdentityQ如Applet、Object、Embed{元素。比如在Applet对象实例中,我们用其Name来引用该对象?/p>

  用?:  在IMG元素和MAP元素之间兌的时候,如果要定义IMG的热点区域,需要用其属性usemapQusemap="#name"(被关联的MAP元素的Name)?/p>

  用?:  某些特定元素的属性,如attributeQ和param。例如ؓ(f)Object定义参数

  昄q些用途都不是能简单的使用ID来代替掉的,所以HTML元素的ID和Name的却别ƈ不是w䆾证号码和姓名q样的区别,它们更本是不同作用的东ѝ?/p>

  当然HTML元素的Name属性在面中也可以起那么一点ID的作用,因ؓ(f)在DHTML对象?wi)中Q我们可以?strong>document.getElementsByName来获取一个包含页面中所有指定Name元素的对象数l?/p>

  在这里顺便说一下,要是面中有n(n>1)个HTML元素的ID都相同了(jin)怎么办?在DHTML对象中怎么引用他们呢?如果我们使用ASPX面Q这L(fng)情况是不Ҏ(gu)发生的,因ؓ(f)aspnetq程在处理aspx面时根本就不允许有ID非唯一Q这是页面会(x)被抛出异常而不能被正常的render。要是不是动态页面,我们要让ID重复那IE怎么搞呢Q?/p>

  q个时候我们还是可以l?strong>document.getElementById获取对象Q只不过我们只能获取ID重复的那些对象中在HTML Render时第一个出现的对象。而这旉复的ID?x)在引用时自动变成一个数l,ID重复的元素按Render的顺序依ơ存在于数组中?



lqx 2008-06-03 21:46 发表评论
]]>[收藏]請教iframe和父H口的問?/title><link>http://www.tkk7.com/lqxue/archive/2008/05/08/199102.html</link><dc:creator>lqx</dc:creator><author>lqx</author><pubDate>Wed, 07 May 2008 16:13:00 GMT</pubDate><guid>http://www.tkk7.com/lqxue/archive/2008/05/08/199102.html</guid><wfw:comment>http://www.tkk7.com/lqxue/comments/199102.html</wfw:comment><comments>http://www.tkk7.com/lqxue/archive/2008/05/08/199102.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/lqxue/comments/commentRss/199102.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/lqxue/services/trackbacks/199102.html</trackback:ping><description><![CDATA[<strong>請教iframe和父H口的問?/strong><br /> <br /> 一個頁面A.asp上含有iframe src="b.asp"Q在B.asp的頁面上有一個會員登入表單,要傳送到C.asp的頁面進行驗證和轉向到會員歷頁面?br /> 這種佈局如果沒有Ҏ(gu)a置Q會看到所有的動作都在A頁面上的那個IFRAMEH口Q而A頁面不會動?br /> 我想請教Q?br /> 1、是否可以做刎ͼ在A頁面上按下B框架的表單提交後Q連同A頁面整個轉向到會員驗證頁,而不是A不動QB頁自p向?br /> <br /> 2、假如會員已dQ那麼在A頁面的iframe中顯C的是會員基本信息(佈局同上Q,並有退出按鈕,在另外一頁D.asp完成清空session功能? 當按下「退出」後Q是否可以在B轉到D.asp頁面清空session值後Q返回時能夠重整A頁面QA現IFRAME內的是登入界面?<br /> <br /> 3、如果頁面上含有iframe,用光標在這個FRAME上拉來拉去,會看到這個框枉會動Q是否有辦法止Q是不是和^時的止左右鍉|法一樣,在FRAME的SRC頁上a置Q?br /> 謝Q? <br /> <table class="tableborder" align="center" cellpadding="4" cellspacing="1" width="98%"> <tbody> <tr> <!-- <table cellspacing="0" cellpadding="0" width="100%"> <td class="bold">hutia</td> <td align="right">2006-4-27 23:02</td> </tr> </table> </td> </tr> <tr> --> <td><img src="http://www.lslnet.com/images/icon_new.gif" border="0" height="18" width="29" alt="" />{?:<br /> <strong><span style="color: red;"> <form target="_top"></span></strong><br /> <br /> {?Q?br /> D.asp<br /> [code]<br /> <%<br /> ' 清空Session 的操?br /> %><br /> <script>top.location.reload();</script><br /> [/code]<br /> <br /> {?Q?br /> ?iframe 的內容尺寸設|的?iframe 外尺寸小卛_。就是說Q定?iframe ?src 頁內容讓它的寸於 A 頁上 iframe 元素的的寸?/td> </tr> </tbody> </table> <br /> <table class="tableborder" align="center" cellpadding="4" cellspacing="1" width="98%"> <tbody> <tr> <!-- <table cellspacing="0" cellpadding="0" width="100%"> <td class="bold">gjr1</td> <td align="right">2006-4-28 02:12</td> </tr> </table> </td> </tr> <tr> --> <td><img src="http://www.lslnet.com/images/icon_new.gif" border="0" height="18" width="29" alt="" />非常感謝版主Q?/td> </tr> </tbody> </table> <br /> <table class="tableborder" align="center" cellpadding="4" cellspacing="1" width="98%"> <tbody> <tr> <!-- <table cellspacing="0" cellpadding="0" width="100%"> <td class="bold">gjr1</td> <td align="right">2006-4-28 06:17</td> </tr> </table> </td> </tr> <tr> --> <td><img src="http://www.lslnet.com/images/icon_new.gif" border="0" height="18" width="29" alt="" />再請教一個問:(x)是否可以在b.asp頁上不做cssa置Q它能和父頁面a.aspq一個style.css文gQ?br /> 謝Q?/td> </tr> </tbody> </table> <br /> <table class="tableborder" align="center" cellpadding="4" cellspacing="1" width="98%"> <tbody> <tr> <!-- <table cellspacing="0" cellpadding="0" width="100%"> <td class="bold">gjr1</td> <td align="right">2006-4-28 10:35</td> </tr> </table> </td> </tr> <tr> --> <td><img src="http://www.lslnet.com/images/icon_new.gif" border="0" height="18" width="29" alt="" />哦,不知道二者能不能q一個CSS文gQ而不用要分別做CSS鏈接Q?br /> <br /> 再頂一下,盼高手指點,謝Q?/td> </tr> </tbody> </table> <br /> <table class="tableborder" align="center" cellpadding="4" cellspacing="1" width="98%"> <tbody> <tr> <!-- <table cellspacing="0" cellpadding="0" width="100%"> <td class="bold">hutia</td> <td align="right">2006-4-28 11:19</td> </tr> </table> </td> </tr> <tr> --> <td><img src="http://www.lslnet.com/images/icon_new.gif" border="0" height="18" width="29" alt="" />{:(x)不能</td> </tr> </tbody> </table> <br /> <!-- <table cellspacing="0" cellpadding="0" width="100%"> <td class="bold">gjr1</td> <td align="right">2006-4-28 13:06</td> </tr> </table> </td> </tr> <tr> --><img src="http://www.lslnet.com/images/icon_new.gif" border="0" height="18" width="29" alt="" />哦,真是可惜?jin),謝Q? <img src ="http://www.tkk7.com/lqxue/aggbug/199102.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/lqxue/" target="_blank">lqx</a> 2008-05-08 00:13 <a href="http://www.tkk7.com/lqxue/archive/2008/05/08/199102.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>html file 标签 ?中文“浏?.." Ҏ(gu)英文http://www.tkk7.com/lqxue/archive/2008/05/07/198975.htmllqxlqxWed, 07 May 2008 07:05:00 GMThttp://www.tkk7.com/lqxue/archive/2008/05/07/198975.htmlhttp://www.tkk7.com/lqxue/comments/198975.htmlhttp://www.tkk7.com/lqxue/archive/2008/05/07/198975.html#Feedback0http://www.tkk7.com/lqxue/comments/commentRss/198975.htmlhttp://www.tkk7.com/lqxue/services/trackbacks/198975.html   <input   name=ff   readonly><input   type=button   value='Browse...'   onclick="document.all.meizz.click()">


lqx 2008-05-07 15:05 发表评论
]]>
在线~辑?/title><link>http://www.tkk7.com/lqxue/archive/2008/02/19/180696.html</link><dc:creator>lqx</dc:creator><author>lqx</author><pubDate>Tue, 19 Feb 2008 07:48:00 GMT</pubDate><guid>http://www.tkk7.com/lqxue/archive/2008/02/19/180696.html</guid><wfw:comment>http://www.tkk7.com/lqxue/comments/180696.html</wfw:comment><comments>http://www.tkk7.com/lqxue/archive/2008/02/19/180696.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/lqxue/comments/commentRss/180696.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/lqxue/services/trackbacks/180696.html</trackback:ping><description><![CDATA[http://www.geniisoft.com/showcase.nsf/WebEditors<br /> <br /> <br /> <img src ="http://www.tkk7.com/lqxue/aggbug/180696.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/lqxue/" target="_blank">lqx</a> 2008-02-19 15:48 <a href="http://www.tkk7.com/lqxue/archive/2008/02/19/180696.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>鼠标拖拽divQ支持w3chttp://www.tkk7.com/lqxue/archive/2007/12/27/170863.htmllqxlqxThu, 27 Dec 2007 05:45:00 GMThttp://www.tkk7.com/lqxue/archive/2007/12/27/170863.htmlhttp://www.tkk7.com/lqxue/comments/170863.htmlhttp://www.tkk7.com/lqxue/archive/2007/12/27/170863.html#Feedback0http://www.tkk7.com/lqxue/comments/commentRss/170863.htmlhttp://www.tkk7.com/lqxue/services/trackbacks/170863.html <head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Binny.cn</title>
<script>
 var obj=0;
 var x=0;
 var y=0;
 var ie = (navigator.appVersion.indexOf("MSIE")!=-1);//IE
 var ff = (navigator.userAgent.indexOf("Firefox")!=-1);//Firefox
 function find(evt,objDiv){
  obj = objDiv
  if (ff){
    x = document.documentElement.scrollLeft + evt.layerX;
    y = document.documentElement.scrollTop + evt.layerY;
   
    if (document.documentElement.scrollTop > 0){
     y = evt.layerY - document.documentElement.scrollTop;
    }
   
    if (document.documentElement.scrollLeft > 0){
     x = evt.layerX - document.documentElement.scrollLeft;
    }
   }
  if (ie){
    x = document.documentElement.scrollLeft + evt.offsetX;
    y = document.documentElement.scrollTop + evt.offsetY;
   
    if (document.documentElement.scrollTop > 0){
     y = evt.offsetY - document.documentElement.scrollTop;
    }
   
    if (document.documentElement.scrollLeft > 0){
     x = evt.offsetX - document.documentElement.scrollLeft;
    }
   }
 }
 function dragit(evt){
  if(obj == 0){
   return false
  }
  else{
   obj.style.left = evt.clientX - x + "px";
   obj.style.top = evt.clientY - y + "px";
  }
 }
</script>
</head>
<body style="margin:0" onmousemove="dragit(event)" onmouseup="obj = 0">

<div id="aaa" style="background-color:red;width:200pt;height:200pt;position:absolute">
<div id="aa" style="width:200pt;height:20pt;background:blue;position:absolute" onmousedown="find(event,document.getElementById('aaa'))"></div>
</div><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
</body>
</html>

摘自Qhttp://www.binny.cn/article.asp?id=232



lqx 2007-12-27 13:45 发表评论
]]>
javascript 判断是否是ieQ是否是特定版本http://www.tkk7.com/lqxue/archive/2007/11/06/158609.htmllqxlqxTue, 06 Nov 2007 09:32:00 GMThttp://www.tkk7.com/lqxue/archive/2007/11/06/158609.htmlhttp://www.tkk7.com/lqxue/comments/158609.htmlhttp://www.tkk7.com/lqxue/archive/2007/11/06/158609.html#Feedback0http://www.tkk7.com/lqxue/comments/commentRss/158609.htmlhttp://www.tkk7.com/lqxue/services/trackbacks/158609.html is_opera = /opera/i.test(navigator.userAgent)
是否是IEQ?br /> is_ie = (/msie/i.test(navigator.userAgent) && !is_opera)

是否是ie7Q?br /> (is_ie && /msie 7\.0/i.test(navigator.userAgent));

lqx 2007-11-06 17:32 发表评论
]]>
[收藏]Core JavaScript 1.5 Reference:Global Objects:RegExphttp://www.tkk7.com/lqxue/archive/2007/10/19/154202.htmllqxlqxFri, 19 Oct 2007 06:31:00 GMThttp://www.tkk7.com/lqxue/archive/2007/10/19/154202.htmlhttp://www.tkk7.com/lqxue/comments/154202.htmlhttp://www.tkk7.com/lqxue/archive/2007/10/19/154202.html#Feedback0http://www.tkk7.com/lqxue/comments/commentRss/154202.htmlhttp://www.tkk7.com/lqxue/services/trackbacks/154202.html

lqx 2007-10-19 14:31 发表评论
]]>
javascript 获得本地时区http://www.tkk7.com/lqxue/archive/2007/09/27/148667.htmllqxlqxThu, 27 Sep 2007 05:27:00 GMThttp://www.tkk7.com/lqxue/archive/2007/09/27/148667.htmlhttp://www.tkk7.com/lqxue/comments/148667.htmlhttp://www.tkk7.com/lqxue/archive/2007/09/27/148667.html#Feedback0http://www.tkk7.com/lqxue/comments/commentRss/148667.htmlhttp://www.tkk7.com/lqxue/services/trackbacks/148667.html var tzo=(new Date().getTimezoneOffset()/60)*(-1);

把其他时区的旉转化成本圎ͼ(x)
function toLocalTime(t){
        document.write(formatDate(new Date(t),'yyyy/MM/dd HH:mm:ss a'));
}

其实Qnew Date(原来旉)Q即可?br />




lqx 2007-09-27 13:27 发表评论
]]>
javascript 判断览器是否支持弹chuH口http://www.tkk7.com/lqxue/archive/2007/08/17/137565.htmllqxlqxFri, 17 Aug 2007 07:56:00 GMThttp://www.tkk7.com/lqxue/archive/2007/08/17/137565.htmlhttp://www.tkk7.com/lqxue/comments/137565.htmlhttp://www.tkk7.com/lqxue/archive/2007/08/17/137565.html#Feedback0http://www.tkk7.com/lqxue/comments/commentRss/137565.htmlhttp://www.tkk7.com/lqxue/services/trackbacks/137565.html                                                      if(k){
                                                          k.focus();
                                                          form.submit();
                                                      }
                                                      if(k == null){
                                                          alert("Sorry,your browser blocked the pop window,please press the 'Ctrl' button or remove the block pop window function!");
                                                      }


lqx 2007-08-17 15:56 发表评论
]]>
面Ҏ(gu)http://www.tkk7.com/lqxue/archive/2007/08/01/133843.htmllqxlqxWed, 01 Aug 2007 09:43:00 GMThttp://www.tkk7.com/lqxue/archive/2007/08/01/133843.htmlhttp://www.tkk7.com/lqxue/comments/133843.htmlhttp://www.tkk7.com/lqxue/archive/2007/08/01/133843.html#Feedback0http://www.tkk7.com/lqxue/comments/commentRss/133843.htmlhttp://www.tkk7.com/lqxue/services/trackbacks/133843.htmlhttp://www.yesky.com/imagesnew/software/jscript/index.html

lqx 2007-08-01 17:43 发表评论
]]>
怎样在jsp中只h囄而不h面Q?http://www.tkk7.com/lqxue/archive/2007/07/31/133503.htmllqxlqxTue, 31 Jul 2007 01:44:00 GMThttp://www.tkk7.com/lqxue/archive/2007/07/31/133503.htmlhttp://www.tkk7.com/lqxue/comments/133503.htmlhttp://www.tkk7.com/lqxue/archive/2007/07/31/133503.html#Feedback0http://www.tkk7.com/lqxue/comments/commentRss/133503.htmlhttp://www.tkk7.com/lqxue/services/trackbacks/133503.htmldocument.getElementById("sample").src="1.gif";
不行Q没有更斎ͼ请问怎么解决呀Q?


~存问题

var img = document.getElementById("sample");
    img.src="1.gif?.tmp="+Math.random();





lqx 2007-07-31 09:44 发表评论
]]>
提供 CheckBox 全選與取消全?/title><link>http://www.tkk7.com/lqxue/archive/2007/07/17/130913.html</link><dc:creator>lqx</dc:creator><author>lqx</author><pubDate>Tue, 17 Jul 2007 11:17:00 GMT</pubDate><guid>http://www.tkk7.com/lqxue/archive/2007/07/17/130913.html</guid><wfw:comment>http://www.tkk7.com/lqxue/comments/130913.html</wfw:comment><comments>http://www.tkk7.com/lqxue/archive/2007/07/17/130913.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/lqxue/comments/commentRss/130913.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/lqxue/services/trackbacks/130913.html</trackback:ping><description><![CDATA[<p><font face="Courier New" color=#ff0000><strong>前言</strong></font></p> <p><font face="Courier New">  提供 CheckBox 全選與取消全?/font></p> <p><strong><font face="Courier New" color=#ff0000>Ҏ(gu)</font></strong></p> <p><font face="Courier New"><script language="JavaScript"><br>function chkall(input1,input2)<br>{<br>    var objForm = document.forms[input1];<br>    var objLen = objForm.length;<br>    for (var iCount = 0; iCount < objLen; iCount++)<br>    {<br>        if (input2.checked == true)<br>        {<br>            if (objForm.elements[iCount].type == "checkbox")<br>            {<br>                objForm.elements[iCount].checked = true;<br>            }<br>        }<br>        else<br>        {<br>            if (objForm.elements[iCount].type == "checkbox")<br>            {<br>                objForm.elements[iCount].checked = false;<br>            }<br>        }<br>    }<br>}<br></script></font></p> <p><font face="Courier New"><form id="form1"><br><input type="checkbox" value='全部選取' onclick='chkall("form1",this)' name=chk><BR><br><input type="checkbox" name="item_001" value="1">1<BR><br><input type="checkbox" name="item_002" value="2">2<BR><br><input type="checkbox" name="item_003" value="3">3<BR><br><input type="checkbox" name="item_003" value="4">4<br></form></font></p> <img src ="http://www.tkk7.com/lqxue/aggbug/130913.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/lqxue/" target="_blank">lqx</a> 2007-07-17 19:17 <a href="http://www.tkk7.com/lqxue/archive/2007/07/17/130913.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>some resources of html or javascripthttp://www.tkk7.com/lqxue/archive/2007/07/09/128997.htmllqxlqxMon, 09 Jul 2007 02:54:00 GMThttp://www.tkk7.com/lqxue/archive/2007/07/09/128997.htmlhttp://www.tkk7.com/lqxue/comments/128997.htmlhttp://www.tkk7.com/lqxue/archive/2007/07/09/128997.html#Feedback0http://www.tkk7.com/lqxue/comments/commentRss/128997.htmlhttp://www.tkk7.com/lqxue/services/trackbacks/128997.htmlhttp://mootools.net/slickspeed/

lqx 2007-07-09 10:54 发表评论
]]>
Inserting objects into HTMLhttp://www.tkk7.com/lqxue/archive/2007/07/08/128872.htmllqxlqxSun, 08 Jul 2007 07:09:00 GMThttp://www.tkk7.com/lqxue/archive/2007/07/08/128872.htmlhttp://www.tkk7.com/lqxue/comments/128872.htmlhttp://www.tkk7.com/lqxue/archive/2007/07/08/128872.html#Feedback0http://www.tkk7.com/lqxue/comments/commentRss/128872.htmlhttp://www.tkk7.com/lqxue/services/trackbacks/128872.htmlhttp://www.w3.org/TR/WD-object-970218

lqx 2007-07-08 15:09 发表评论
]]>
radio & labelhttp://www.tkk7.com/lqxue/archive/2007/06/06/122400.htmllqxlqxWed, 06 Jun 2007 08:39:00 GMThttp://www.tkk7.com/lqxue/archive/2007/06/06/122400.htmlhttp://www.tkk7.com/lqxue/comments/122400.htmlhttp://www.tkk7.com/lqxue/archive/2007/06/06/122400.html#Feedback0http://www.tkk7.com/lqxue/comments/commentRss/122400.htmlhttp://www.tkk7.com/lqxue/services/trackbacks/122400.htmlThis example uses the LABEL object and the accessKey property to set focus on a text box.

Sample Code

<LABEL FOR="oCtrlID" ACCESSKEY="1">
    #
<U>1</U>: Press Alt+1 to set focus to textbox
</LABEL>
<INPUT TYPE="text" NAME="TXT1" VALUE="binding sample 1" 
       SIZE
="20" TABINDEX="1" ID="oCtrlID">




lqx 2007-06-06 16:39 发表评论
]]>
վ֩ģ壺 ɫƬ߹ۿ| ƷѵĻվ| ޾ҹþþþþ| Avһ| H⶯߹ۿ鶹| ҹѸ߹ۿ| Ƶһ߹ۿ| οŮվѴȫ| AVҹҹþ| ŷ޾Ʒһ| aƬ߲| jlzzjlzz߲Ƶ| Ʒպþ| þ99ۺϾƷ| ݺۺɫ| ޳aƬ߹ۿ| ԻƵ40Կ | þù޵Ӱ| 뾫Ʒһ| Ƶ| ޹av| ѹվ߹ۿ15| 벻AV鶹| ĻƵ| ˰ձƵ| һ| 18վ| Ƶ߲| 99þ޾ƷѶ| ޲avһ| йavƬ| þɫһ| ѹvaƵ߹ۿ| Ʒҹѹۿ| 2018| һƵվ| tsվ| ѿAAƬƵ| ŷ޾þþƷ| 4huĻѵַ| ŷƵ߹ۿ|