<?xml version="1.0" encoding="gb2312"?>
<rss version="2.0">
<channel>
<title><![CDATA[blah, blah, blah]]></title>
        <image>
        <title>http://hi.baidu.com</title>
        <link>http://hi.baidu.com</link>
        <url>http://img.baidu.com/img/logo-hi.gif</url>
        </image>
<description><![CDATA[想从这里找原创？没门，hohoho]]></description>
<link>http://hi.baidu.com/dorachopper</link>
<language>zh-cn</language>
<generator>www.baidu.com</generator>
<ttl>5</ttl>


<item>
        <title><![CDATA[YUI: DataTable Control]]></title>
        <link><![CDATA[http://hi.baidu.com/dorachopper/blog/item/d6408ef0083831a5a40f52fc.html]]></link>
        <description><![CDATA[
		
		<p>网上的资料少之又少，先归纳如下</p>
<p> </p>
<p><a href="http://yuiblog.com/blog/2007/09/26/satyam-datatable-2/">http://yuiblog.com/blog/2007/09/26/satyam-datatable-2/</a></p> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/dorachopper/blog/category/Yahoo%20Ui">Yahoo Ui</a>&nbsp;<a href="http://hi.baidu.com/dorachopper/blog/item/d6408ef0083831a5a40f52fc.html#comment">查看评论</a>]]></description>
        <pubDate>2009-10-22  09:59</pubDate>
        <category><![CDATA[Yahoo Ui]]></category>
        <author><![CDATA[哆啦乔巴]]></author>
		<guid>http://hi.baidu.com/dorachopper/blog/item/d6408ef0083831a5a40f52fc.html</guid>
</item>

<item>
        <title><![CDATA[temp]]></title>
        <link><![CDATA[http://hi.baidu.com/dorachopper/blog/item/ac37fe4ffd758031afc3ab85.html]]></link>
        <description><![CDATA[
		
		<p>@echo off</p>
<p>SETLOCAL<br>
net start IBMHTTPAdministration6.1<br>
net start IBMHTTPServer6.1<br>
ENDLOCAL</p>
<p>set MYERRORLEVEL=%ERRORLEVEL%<br>
if defined PROFILE_CONFIG_ACTION exit %MYERRORLEVEL% else exit /b %MYERRORLEVEL%</p> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/dorachopper/blog/category/%C4%AC%C8%CF%B7%D6%C0%E0">默认分类</a>&nbsp;<a href="http://hi.baidu.com/dorachopper/blog/item/ac37fe4ffd758031afc3ab85.html#comment">查看评论</a>]]></description>
        <pubDate>2008-12-24  15:20</pubDate>
        <category><![CDATA[默认分类]]></category>
        <author><![CDATA[哆啦乔巴]]></author>
		<guid>http://hi.baidu.com/dorachopper/blog/item/ac37fe4ffd758031afc3ab85.html</guid>
</item>

<item>
        <title><![CDATA[如何从用户传入的参数中去掉引号？[windows .bat]]]></title>
        <link><![CDATA[http://hi.baidu.com/dorachopper/blog/item/0d28ff08531d0bd663d98620.html]]></link>
        <description><![CDATA[
		
		<p style="margin-bottom: 0pt"><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">很多情况下，我们需要脱除一个字符串中可能会存在的引号，然后在加上自己的引号使其中的特殊字符（命令连接符</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">&amp; </span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">、</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">| </span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">、</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">&amp;&amp;</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">、</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">||</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">，命令行参数界定符</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">Space </span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">、</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">tab </span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">、</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">; </span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">、</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">= </span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">，字符化转义符</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">^ </span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">、</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">&quot; </span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">，变量化转义符</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">% </span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">等）字符化，失去特定的作用，而作为普通的字符成为字符串的一个组成部分。</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-"><br>
<br>
</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">一、将字符串中的引号脱去的简单办法有三种，它们的功能相近，只是各自的使用场合不同，可以处理大多数的情况。</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-"><br>
<br>
1-1 </span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">、如果字符串存在于命令行参数</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">%1</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">中，可以使用</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">%~1 </span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">脱去第一对外侧引号，如果没有外侧引号则字符串不变；</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-"><br>
<br>
1-2 </span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">、如果字符串存在于</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">for </span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">替代变量</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">%%i </span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">中，可以使用</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">%%~i</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">脱去第一对外侧引号，如果没有外侧引号则字符串不变；</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-"><br>
<br>
1-3 </span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">、如果字符串存在于环境变量</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">%temp%</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">中，可以使用</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">%temp:&quot;=% </span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">脱去其中所有的引号，如果没有引号则字符串不变；</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-"><br>
<br>
1-4 </span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">、以上三种方案在某种程度上可以互相通用，因为它们作为变量的一种类型，可以通过类似以下的代码或代码片断相互转移：</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-"><br>
<br>
&nbsp;&nbsp;  1-4-1</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">、</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">for</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">替代变量转命令行参数：</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-"> call:DeQuote %%i<br>
&nbsp;&nbsp;  1-4-2</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">、环境变量转命令行参数：</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">call:DeQuote %temp%<br>
&nbsp;&nbsp;  1-4-3</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">、命令行参数转</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">for</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">替代变量：</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">for %%i in (%1) do ...<br>
&nbsp;&nbsp;  1-4-4</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">、环境变量转</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">for</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">替代变量：</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">for %%i in (%temp%) do ...<br>
&nbsp;&nbsp;  1-4-5</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">、命令行参数转环境变量：</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">set temp=%1<br>
&nbsp;&nbsp;  1-4-6</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">、</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">for</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">替代变量转环境变量：</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">for ... set temp=%%i<br>
<br>
</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">二、如果字符串的引号分布情况很复杂，或者我们对被脱去引号的位置有特殊要求，或者字符串中可能出现某些控制字符，则可以将字符串首先通过</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">1-4 </span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">中的对应方法转存至环境变量中，在使用以下方案或其组合进行处理：</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-"><br>
<br>
2-1 </span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">、可以使用</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">set var=%var:~1%</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">脱去环境变量</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">var </span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">串首的第一个引号，如果串首不存在引号则第一个字符被脱去；</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-"><br>
<br>
2-2 </span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">、可以使用</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">set %var:*&quot;=% </span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">脱去环境变量</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">var </span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">串首的第一个引号，如果串首不存在引号则变量值不变；</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-"><br>
<br>
2-3 </span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">、可以使用</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">set var=%var:~0,-1% </span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">脱去环境变量</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">var </span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">串尾的最后一个引号，如果串尾不存在引号则最后一个被脱去；</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-"><br>
<br>
2-4 </span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">、可以使用</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">set &quot;var=%var%</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">脱去环境变量</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">var </span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">串尾的最后一个引号，如果串尾不存在引号则环境变量被清空；</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-"><br>
<br>
2-5 </span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">、可以使用</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">set var=%var:~1,-1% </span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">脱去环境变量</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">var </span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">串最外侧的一对引号，如果串外侧不存在引号则外侧一对字符被脱去；</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-"><br>
<br>
2-6 </span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">、可以使用</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">%var:*&quot;=set &quot;var=%</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">脱去环境变量</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">var </span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">串最外侧的一对引号，如果串外侧不存在引号则出现语法错误；</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-"><br>
<br>
2-7 </span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">、可以使用</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">set &quot;var=%var:&quot;=%&quot;</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">脱去环境变量</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">var </span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">串中可能出现的所有引号，如果串外侧不出现引号则变量值不变；与</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">1-3 </span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-">不同的是，它容许字符串的匹配引号对内出现特殊控制字符；</span><span style="font-size: 10.5pt;  mso-bidi-font-size: 12.0pt; mso-bidi- mso-font-kerning: 1.0pt; mso-fareast-"><br>
<br>
from :http://www.cn-dos.net/forum/viewthread.php?tid=20838</span><span style="font-size: 9.5pt;  mso-fareast-"></span></p> <a href="http://hi.baidu.com/dorachopper/blog/item/0d28ff08531d0bd663d98620.html">阅读全文</a>
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/dorachopper/blog/category/%B2%D9%D7%F7%CF%B5%CD%B3">操作系统</a>&nbsp;<a href="http://hi.baidu.com/dorachopper/blog/item/0d28ff08531d0bd663d98620.html#comment">查看评论</a>]]></description>
        <pubDate>2008-10-30  16:35</pubDate>
        <category><![CDATA[操作系统]]></category>
        <author><![CDATA[哆啦乔巴]]></author>
		<guid>http://hi.baidu.com/dorachopper/blog/item/0d28ff08531d0bd663d98620.html</guid>
</item>

<item>
        <title><![CDATA[批处理中的IF ERRORLEVEL]]></title>
        <link><![CDATA[http://hi.baidu.com/dorachopper/blog/item/c10fed383e5100f4b211c709.html]]></link>
        <description><![CDATA[
		
		<div class="postbody">
<p><font face="Verdana">@echo off</font></p>
<p><font face="Verdana">ping www.sina.com.cn -n 1<br>
IF ERRORLEVEL 1 goto 拨号<br>
IF ERRORLEVEL 0 goto 断开</font></p>
<p><font face="Verdana">:拨号<br>
echo 开始拨号.....<br>
rasdial adsl sd5555@xmadsl cns004335<br>
goto 结束</font></p>
<p><font face="Verdana">:断开<br>
echo 断开拨号.....<br>
rasdial adsl /d<br>
goto 结束</font></p>
<p><font face="Verdana">:结束<br>
<br>
今天远程一个客户，发现他的服务器会不定时自动断开网络，导致客户端连接不了服务端，但是重启服务以后又恢复正常，初步判断可能是由于某个系统服务与winpacp有冲突，建议用户恢复操作系统，他想等晚上再开始操作，今天就只好一直运行个ping，发现timed out就手动重启服务。我记得if可以利用程序的返回值作为判断，就帮他写了这个脚本：<br>
@echo off<br>
: p<br>
ping 61.152.XX.XX<br>
IF ERRORLEVEL 1 goto aa<br>
IF ERRORLEVEL 0 goto bb<br>
:aa<br>
echo 正在重启软件服务...<br>
net stop MSSQLSERVER<br>
net start MSSQLSERVER<br>
goto p<br>
:bb<br>
echo 继续ping中。。。<br>
goto p<br>
<br>
这段命令的作用是，ping 61.152.XX.XX这个IP，如果ping不通则重启mssql服务，然后继续ping，如果能够ping通，还是继续ping...<br>
<br>
我们都知道if是命令行下的一个条件判断语句，ERRORLEVEL是它的一个参数，翻译过来就是&ldquo;错误返回码&rdquo;的意思，它的作用是判断前一条命令的错误返回值，然后和定义的字符值进行比较，再决定进行什么动作。<br>
格式是这样：<br>
if ERRORLEVEL nubmer commend<br>
例：if ERRORLEVEL 1 echo 返回值等于1<br>
<br>
那么大家就要问了，我怎么获取到前一个命令的返回值呢？<br>
方法很简单，拿ping来说，我们先运行一个ping 127.0.0.1<br>
运行结果是Reply from 127.0.0.1: bytes=32 time&lt;1ms TTL=128<br>
这时候我们输入，echo %errorlevel%，就可以看到返回值是0，<br>
然后我们在ping一个不存在的ip,比如192.192.192.192<br>
ping命令显示 Request timed out.。<br>
ok,我们在用echo %errorlevel%查一下返回值是多少。<br>
现在变成了1。<br>
<br>
你也可以用这个方法来查询其他命令的返回值，比如copy、dir等等。<br>
当然if ERRORLEVEL对数值的比较方法不仅仅限于等于。在微软的帮助中我们可以看到：<br>
<br>
IF %ERRORLEVEL% LEQ 1 goto okay<br>
<br>
这里的LEQ表示&ldquo;小于等于&rdquo;，全部的比较参数如下： </font></p>
<p>EQU - 等于<br>
NEQ - 不等于<br>
LSS - 小于<br>
LEQ - 小于或等于<br>
GTR - 大于<br>
GEQ - 大于或等于<br>
<br>
如有错误，感谢指正。</p>
<p>FROM: <a href="http://www.cnblogs.com/chengulv/archive/2008/05/15/1197521.html">http://www.cnblogs.com/chengulv/archive/2008/05/15/1197521.html</a></p>
</div> <a href="http://hi.baidu.com/dorachopper/blog/item/c10fed383e5100f4b211c709.html">阅读全文</a>
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/dorachopper/blog/category/%B2%D9%D7%F7%CF%B5%CD%B3">操作系统</a>&nbsp;<a href="http://hi.baidu.com/dorachopper/blog/item/c10fed383e5100f4b211c709.html#comment">查看评论</a>]]></description>
        <pubDate>2008-10-27  10:30</pubDate>
        <category><![CDATA[操作系统]]></category>
        <author><![CDATA[哆啦乔巴]]></author>
		<guid>http://hi.baidu.com/dorachopper/blog/item/c10fed383e5100f4b211c709.html</guid>
</item>

<item>
        <title><![CDATA[connect and disconnect a network drive in Windows XP]]></title>
        <link><![CDATA[http://hi.baidu.com/dorachopper/blog/item/d354c8fa13068f8f9f514642.html]]></link>
        <description><![CDATA[
		
		<p>●local drive</p>
<p>subst H: E:\DiskB<br>
subst H: /D</p>
<p>●network drive</p>
<p>net use H: <a href="file://157.69.132.210/temp">\\157.69.132.210\temp</a> pass /USER:user<br>
net use H: /D</p> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/dorachopper/blog/category/javascript%20%26%2338%3B%26%2338%3B%20web">javascript &#38;&#38; web</a>&nbsp;<a href="http://hi.baidu.com/dorachopper/blog/item/d354c8fa13068f8f9f514642.html#comment">查看评论</a>]]></description>
        <pubDate>2008-10-24  17:04</pubDate>
        <category><![CDATA[javascript &#38;&#38; web]]></category>
        <author><![CDATA[哆啦乔巴]]></author>
		<guid>http://hi.baidu.com/dorachopper/blog/item/d354c8fa13068f8f9f514642.html</guid>
</item>

<item>
        <title><![CDATA[Plugging Aptana into an existing Eclipse configuration]]></title>
        <link><![CDATA[http://hi.baidu.com/dorachopper/blog/item/b3dc71544f234f193b29354c.html]]></link>
        <description><![CDATA[
		
		<p> </p>
<p>Aptana：</p>
<p>很好用的JavaScript, CSS, HTML  IDE。不妨试试。也可以集成到Eclipse里。</p>
<p><a href="http://www.aptana.com/docs/index.php/Plugging_Aptana_into_an_existing_Eclipse_configuration">http://www.aptana.com/docs/index.php/Plugging_Aptana_into_an_existing_Eclipse_configuration</a></p> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/dorachopper/blog/category/%B9%A4%BE%DF">工具</a>&nbsp;<a href="http://hi.baidu.com/dorachopper/blog/item/b3dc71544f234f193b29354c.html#comment">查看评论</a>]]></description>
        <pubDate>2008-09-30  14:19</pubDate>
        <category><![CDATA[工具]]></category>
        <author><![CDATA[哆啦乔巴]]></author>
		<guid>http://hi.baidu.com/dorachopper/blog/item/b3dc71544f234f193b29354c.html</guid>
</item>

<item>
        <title><![CDATA[showModalDialog提交表单时弹出新窗口的解决方法]]></title>
        <link><![CDATA[http://hi.baidu.com/dorachopper/blog/item/bb6d4c3522ed268da61e1215.html]]></link>
        <description><![CDATA[
		
		<p>给窗口设个名字，然后把form的target设为那个名字就欧了</p>
<p>window.name = &quot;mywindow&quot;;<br>
window.document.forms[0].submit();</p>
<p> </p>
<p>&lt;html:form action=&quot;/Action&quot; method=&quot;post&quot; target=&quot;mywindow&quot;&gt;</p>
<p>&lt;/html:form&gt;</p> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/dorachopper/blog/category/javascript%20%26%2338%3B%26%2338%3B%20web">javascript &#38;&#38; web</a>&nbsp;<a href="http://hi.baidu.com/dorachopper/blog/item/bb6d4c3522ed268da61e1215.html#comment">查看评论</a>]]></description>
        <pubDate>2008-09-17  10:00</pubDate>
        <category><![CDATA[javascript &#38;&#38; web]]></category>
        <author><![CDATA[哆啦乔巴]]></author>
		<guid>http://hi.baidu.com/dorachopper/blog/item/bb6d4c3522ed268da61e1215.html</guid>
</item>

<item>
        <title><![CDATA[监听窗口关闭，onbeforeunload事件]]></title>
        <link><![CDATA[http://hi.baidu.com/dorachopper/blog/item/755df1f31afc01cd0a46e0f5.html]]></link>
        <description><![CDATA[
		
		<p>用户不进行注销或者退出功能, 直接关闭了浏览器.<br>
或者用户在进行输入操作时, 误点了一个链接, 跳转到其它页面, 造成输入数据的丢失.<br>
<br>
今天发现了onbeforeunload事件，它是这样用的： &lt;script language=&quot;javascript&quot;&gt;<br>
g_blnCheckUnload = true;<br>
function RunOnBeforeUnload() {<br>
if (g_blnCheckUnload) <br>
　　　{//注意异常的捕获<br>
　　　　　try{<br>
　　　　　　 window.event.returnValue = 'You will lose any unsaved content'; <br>
}catch(e){}<br>
　} <br>
<br>
}<br>
&lt;/script&gt;<br>
&lt;body onbeforeunload=&quot;RunOnBeforeUnload()&quot;&gt;<br>
&lt;/body&gt;<br>
这样每次关闭浏览器窗口或涮新页面时，都要触发onbeforeunload这个事件，这样可以对用户进行提示，避免不必要的遗憾。<br>
<br>
我上网又查了一些这个事件的用法，感觉还是<a href="http://www.surfchen.org/?p=54" target="_blank">http://www.surfchen.org/?p=54</a>这篇写得最清楚了，摘抄如下：<br>
<br>
onbeforeunload事件： <br>
注：三大主流浏览器中firefox和IE都支持onbeforeunload事件,opera尚未支持。<br>
<br>
用法：<br>
<br>
object.onbeforeunload = handler &lt;element onbeforeunload = &ldquo;handler&rdquo; … &gt;&lt;/element&gt; 描述：<br>
事件触发的时候弹出一个有确定和取消的对话框，确定则离开页面，取消则继续待在本页。<br>
handler可以设一个返回值作为该对话框的显示文本。<br>
<br>
触发于：<br>
<br>
关闭浏览器窗口 <br>
通过地址栏或收藏夹前往其他页面的时候 <br>
点击返回，前进，刷新，主页其中一个的时候 <br>
点击 一个前往其他页面的url连接的时候 <br>
调用以下任意一个事件的时候：click，document write，document open，document close，window close ，window navigate ，window NavigateAndFind,location replace,location reload,form submit. <br>
当用window open打开一个页面，并把本页的window的名字传给要打开的页面的时候。 <br>
重新赋予location.href的值的时候。 <br>
通过input type=&rdquo;submit&rdquo;按钮提交一个具有指定action的表单的时候。 <br>
可以用在以下元素：<br>
BODY, FRAMESET, window&nbsp;&nbsp;</p>
<p>平台支持：<br>
IE4+/Win, Mozilla 1.7a+, Netscape 7.2+, Firefox0.9+</p>
<p><font size="2">from：</font><a href="http://blog.csdn.net/changlich/archive/2006/08/09/1043740.aspx"><font size="2">http://blog.csdn.net/changlich/archive/2006/08/09/1043740.aspx</font></a></p> <a href="http://hi.baidu.com/dorachopper/blog/item/755df1f31afc01cd0a46e0f5.html">阅读全文</a>
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/dorachopper/blog/category/javascript%20%26%2338%3B%26%2338%3B%20web">javascript &#38;&#38; web</a>&nbsp;<a href="http://hi.baidu.com/dorachopper/blog/item/755df1f31afc01cd0a46e0f5.html#comment">查看评论</a>]]></description>
        <pubDate>2008-08-29  12:12</pubDate>
        <category><![CDATA[javascript &#38;&#38; web]]></category>
        <author><![CDATA[哆啦乔巴]]></author>
		<guid>http://hi.baidu.com/dorachopper/blog/item/755df1f31afc01cd0a46e0f5.html</guid>
</item>

<item>
        <title><![CDATA[window 和 frame 关系的错误理解及正确使用]]></title>
        <link><![CDATA[http://hi.baidu.com/dorachopper/blog/item/3e884bfd3e94a61008244d28.html]]></link>
        <description><![CDATA[
		
		<div class="cnt" >对 window 和 frame 关系的错误理解是web开发者中普遍存在的问题，从 (x) html 和 Javascrīpt 来看，每个窗口中 显示的 frame 都能很容易的控制，事实上，当一个 window 有多个 frame ， 可以通过 window.frames[] 来实现对每 个独立的窗口目标的引用，一些简单却很有用的属性在下表中列举出来：<br>
<br>
<table border="1">
    <tbody>
        <tr>
            <th>Window 属性</th>
            <th>说明</th>
        </tr>
        <tr>
            <td>frames[]</td>
            <td>存放当前窗口中所有frame对象的数组。</td>
        </tr>
        <tr>
            <td>length</td>
            <td>窗口 frame. 的数目，和 window.frames.length 等同。</td>
        </tr>
        <tr>
            <td>name</td>
            <td>当前窗口的名字，自 Javascrīpt 1.1 起，这个值是可读写的。</td>
        </tr>
        <tr>
            <td>parent</td>
            <td>对父窗口的引用。</td>
        </tr>
        <tr>
            <td>self</td>
            <td>对窗口自身的引用。</td>
        </tr>
        <tr>
            <td>top</td>
            <td>对最高级别窗口的引用，这个值通常和parent一致，除非 frame. 中有更多的 frame。</td>
        </tr>
        <tr>
            <td>window</td>
            <td>另外一个对当前窗口的引用。</td>
        </tr>
    </tbody>
</table>
<br>
<br>
想用 Javascrīpt 控制 frame 最主要的是要把各自的名字和他们之间的关系弄清楚，如果你有一个叫 frames.html 的页面，页面代码如下：<span class="code_title"><br>
<br>
HTML:<br>
</span>
<div class="code_container">
<pre class="html4strict"><ol><li class="li1"><div class="de1"> </div></li><li class="li1"><div class="de1"><span class="sc0">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Frameset//EN&quot; </span></div></li><li class="li1"><div class="de1">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd&quot;&gt;</div></li><li class="li1"><div class="de1"><span class="sc2"><span class="kw2">&lt;html</span> xmlns=<span class="st0">&quot;http://www.w3.org/1999/xhtml&quot;</span><span class="kw2">&gt;</span></span></div></li><li class="li2"><div class="de2"><span class="sc2"><span class="kw2">&lt;head&gt;</span></span></div></li><li class="li1"><div class="de1"><span class="sc2"><span class="kw2">&lt;title&gt;</span></span>FrameSet Test<span class="sc2"><span class="kw2">&lt;/title&gt;</span></span></div></li><li class="li1"><div class="de1"><span class="sc2"><span class="kw2">&lt;meta</span> <span class="kw3">http-equiv</span>=<span class="st0">&quot;content-type&quot;</span> <span class="kw3">content</span>=<span class="st0">&quot;text/html; charset=ISO-8859-1&quot;</span> /<span class="kw2">&gt;</span></span></div></li><li class="li1"><div class="de1"><span class="sc2"><span class="kw2">&lt;/head&gt;</span></span></div></li><li class="li1"><div class="de1"><span class="sc2"><span class="kw2">&lt;frameset</span> <span class="kw3">rows</span>=<span class="st0">&quot;33%,*,33%&quot;</span><span class="kw2">&gt;</span></span></div></li><li class="li2"><div class="de2"><span class="sc2"><span class="kw2">&lt;frame</span> <span class="kw3">src</span>=<span class="st0">&quot;framerelationship.html&quot;</span> <span class="kw3">name</span>=<span class="st0">&quot;frame1&quot;</span> <span class="kw3">id</span>=<span class="st0">&quot;frame1&quot;</span> /<span class="kw2">&gt;</span></span></div></li><li class="li1"><div class="de1"><span class="sc2"><span class="kw2">&lt;frame</span> <span class="kw3">src</span>=<span class="st0">&quot;moreframes.html&quot;</span> <span class="kw3">name</span>=<span class="st0">&quot;frame2&quot;</span> <span class="kw3">id</span>=<span class="st0">&quot;frame2&quot;</span> /<span class="kw2">&gt;</span></span></div></li><li class="li1"><div class="de1"><span class="sc2"><span class="kw2">&lt;frame</span> <span class="kw3">src</span>=<span class="st0">&quot;framerelationship.html&quot;</span> <span class="kw3">name</span>=<span class="st0">&quot;frame5&quot;</span> <span class="kw3">id</span>=<span class="st0">&quot;frame5&quot;</span> /<span class="kw2">&gt;</span></span></div></li><li class="li1"><div class="de1"><span class="sc2"><span class="kw2">&lt;/frameset&gt;</span></span></div></li><li class="li1"><div class="de1"><span class="sc2"><span class="kw2">&lt;/html&gt;</span></span></div></li><li class="li2"><div class="de2"> </div></li></ol></pre>
</div>
<br>
<br>
在这种情况下，当前文档主体可以看作是三个 frame （frame1,frame2, and frame5） 的 parent ，你可以使用下面的方式取得 frame 数目：<br>
<span style="font-weight: bold; margin: 0px 10px">Code:</span>
<div style="border-right: rgb(204,204,204) 1px dotted; padding-right: 5px; border-top: rgb(204,204,204) 1px dotted; padding-left: 5px; padding-bottom: 5px; margin: 0px 10px; overflow: auto; border-left: rgb(204,204,204) 1px dotted; color: darkred; padding-top: 5px; border-bottom: rgb(204,204,204) 1px dotted; background-color: rgb(247,247,247)"><br>
window.frames.length</div>
<br>
<br>
你如果在三个子 frame 中运行代码，可以用下面的方法 ：<br>
<span style="font-weight: bold; margin: 0px 10px">Code:</span>
<div style="border-right: rgb(204,204,204) 1px dotted; padding-right: 5px; border-top: rgb(204,204,204) 1px dotted; padding-left: 5px; padding-bottom: 5px; margin: 0px 10px; overflow: auto; border-left: rgb(204,204,204) 1px dotted; color: darkred; padding-top: 5px; border-bottom: rgb(204,204,204) 1px dotted; background-color: rgb(247,247,247)"><br>
window.parent.frames.length</div>
<br>
或者<br>
<span style="font-weight: bold; margin: 0px 10px">Code:</span>
<div style="border-right: rgb(204,204,204) 1px dotted; padding-right: 5px; border-top: rgb(204,204,204) 1px dotted; padding-left: 5px; padding-bottom: 5px; margin: 0px 10px; overflow: auto; border-left: rgb(204,204,204) 1px dotted; color: darkred; padding-top: 5px; border-bottom: rgb(204,204,204) 1px dotted; background-color: rgb(247,247,247)"><br>
parent.frames.length</div>
<br>
<br>
<strong>parent</strong> 表示一个窗体的父窗体，也可以用 <strong>top</strong> 来表示最高级别的窗体，这样可以写成 <strong>top.frames.length</strong> ，但是需要注意的是：除非你有嵌套 frame ，否则 parent 和 top 通常表示的是一个对象。<br>
<br>
访 问一个 frame ，可以用 name 或者下标的方式查询 frames 数组，parent.frames[0].name 将会输出第一个 frame 的名字，在我们的例子中就是 frame1，同样，我们也可以用 parent.frame1 或者&nbsp;&nbsp;  parent.frames [&quot;frame1&quot;] 来实现相同的操作，记住，一个 frame 就是一个 window，知道这个，就可以使用所有Window 和 Document 的方法。<br>
<br>
当理解了 frame 之间的关系，可以很容易的通过 parent.frames[] 操作任何 frame ，假如你有一个简单的框架页面：<br>
<span class="code_title">HTML:</span>
<div class="code_container">
<pre class="html4strict"><ol><li class="li1"><div class="de1"> </div></li><li class="li1"><div class="de1"><span class="sc0">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Frameset//EN&quot; </span></div></li><li class="li1"><div class="de1">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd&quot;&gt;</div></li><li class="li1"><div class="de1"><span class="sc2"><span class="kw2">&lt;html</span> xmlns=<span class="st0">&quot;http://www.w3.org/1999/xhtml&quot;</span><span class="kw2">&gt;</span></span></div></li><li class="li2"><div class="de2"><span class="sc2"><span class="kw2">&lt;head&gt;</span></span></div></li><li class="li1"><div class="de1"><span class="sc2"><span class="kw2">&lt;title&gt;</span></span>Two Frames<span class="sc2"><span class="kw2">&lt;/title&gt;</span></span></div></li><li class="li1"><div class="de1"><span class="sc2"><span class="kw2">&lt;meta</span> <span class="kw3">http-equiv</span>=<span class="st0">&quot;content-type&quot;</span> <span class="kw3">content</span>=<span class="st0">&quot;text/html; charset=ISO-8859-1&quot;</span> /<span class="kw2">&gt;</span></span></div></li><li class="li1"><div class="de1"><span class="sc2"><span class="kw2">&lt;/head&gt;</span></span></div></li><li class="li1"><div class="de1"><span class="sc2"><span class="kw2">&lt;frameset</span> <span class="kw3">cols</span>=<span class="st0">&quot;300,*&quot;</span><span class="kw2">&gt;</span></span></div></li><li class="li2"><div class="de2"><span class="sc2"><span class="kw2">&lt;frame</span> <span class="kw3">src</span>=<span class="st0">&quot;navigation.html&quot;</span> <span class="kw3">name</span>=<span class="st0">&quot;frame1&quot;</span> <span class="kw3">id</span>=<span class="st0">&quot;frame1&quot;</span> /<span class="kw2">&gt;</span></span></div></li><li class="li1"><div class="de1"><span class="sc2"><span class="kw2">&lt;frame</span> <span class="kw3">src</span>=<span class="st0">&quot;content.html&quot;</span> <span class="kw3">name</span>=<span class="st0">&quot;frame2&quot;</span> <span class="kw3">id</span>=<span class="st0">&quot;frame2&quot;</span> /<span class="kw2">&gt;</span></span></div></li><li class="li1"><div class="de1"><span class="sc2"><span class="kw2">&lt;/frameset&gt;</span></span></div></li><li class="li1"><div class="de1"><span class="sc2"><span class="kw2">&lt;/html&gt;</span></span></div></li><li class="li1"><div class="de1"> </div></li></ol></pre>
</div>
<br>
<br>
在 navigation 窗体里面，你可以通过下面的方式设置一个对 content 窗体引用的变量：<br>
<span style="font-weight: bold; margin: 0px 10px">Code:</span>
<div style="border-right: rgb(204,204,204) 1px dotted; padding-right: 5px; border-top: rgb(204,204,204) 1px dotted; padding-left: 5px; padding-bottom: 5px; margin: 0px 10px; overflow: auto; border-left: rgb(204,204,204) 1px dotted; color: darkred; padding-top: 5px; border-bottom: rgb(204,204,204) 1px dotted; background-color: rgb(247,247,247)"><br>
var contentFrame = parent.frames[1]; // 或者使用名称</div>
<br>
<br>
<br>
iframe 是一个需要注意的 frame 变种，用iframe可以让你不使用框架，但是却可以嵌入页面，问题是，我们如何控制这些 iframe ？事实上，我们也可以用 frames[] 的方法，此外，如果你的 iframe 有命名，可以通过 <strong>getElementById</strong> 来操控，示例如下：<br>
<span class="code_title">HTML:</span>
<div class="code_container">
<pre class="html4strict"><ol><li class="li1"><div class="de1"> </div></li><li class="li1"><div class="de1"><span class="sc2"><span class="kw2">&lt;iframe</span> <span class="kw3">src</span>=<span class="st0">&quot;http://www.google.com&quot;</span> <span class="kw3">name</span>=<span class="st0">&quot;iframe1&quot;</span> <span class="kw3">id</span>=<span class="st0">&quot;iframe1&quot;</span> <span class="kw3">height</span>=<span class="st0">&quot;200&quot;</span> <span class="kw3">width</span>=<span class="st0">&quot;200&quot;</span><span class="kw2">&gt;</span></span><span class="sc2"><span class="kw2">&lt;/iframe&gt;</span></span></div></li><li class="li1"><div class="de1"><span class="sc2"><span class="kw2">&lt;form</span> <span class="kw3">action</span>=<span class="st0">&quot;#&quot;</span> <span class="kw3">method</span>=<span class="st0">&quot;get&quot;</span><span class="kw2">&gt;</span></span></div></li><li class="li1"><div class="de1"><span class="sc2"><span class="kw2">&lt;input</span> <span class="kw3">type</span>=<span class="st0">&quot;button&quot;</span> <span class="kw3">value</span>=<span class="st0">&quot;Load by Frames Array&quot;</span> </span></div></li><li class="li2"><div class="de2"><span class="kw3">onclick</span>=<span class="st0">&quot;frames['iframe1'].location='http://www.javascrīptref.com';&quot;</span> /<span class="kw2">&gt;</span></div></li><li class="li1"><div class="de1"><span class="sc2"><span class="kw2">&lt;input</span> <span class="kw3">type</span>=<span class="st0">&quot;button&quot;</span> <span class="kw3">value</span>=<span class="st0">&quot;Load by DOM&quot;</span> </span></div></li><li class="li1"><div class="de1"><span class="kw3">onclick</span>=<span class="st0">&quot;document.getElementById('iframe1').src='http://www.pint.com';&quot;</span> /<span class="kw2">&gt;</span></div></li><li class="li1"><div class="de1"><span class="sc2"><span class="kw2">&lt;/form&gt;</span></span></div></li><li class="li1"><div class="de1"> </div></li></ol></pre>
</div>
<br>
<br>
可以通过在链接标签里面加上 target 来将操作指向目标 frame ：<br>
<span style="font-weight: bold; margin: 0px 10px">Code:</span>
<div style="border-right: rgb(204,204,204) 1px dotted; padding-right: 5px; border-top: rgb(204,204,204) 1px dotted; padding-left: 5px; padding-bottom: 5px; margin: 0px 10px; overflow: auto; border-left: rgb(204,204,204) 1px dotted; color: darkred; padding-top: 5px; border-bottom: rgb(204,204,204) 1px dotted; background-color: rgb(247,247,247)"><br>
&lt;a href=&quot;http://www.google.com&quot; target=&quot;framename&quot;&gt;Google&lt;/a&gt;</div>
</div>
<br> <a href="http://hi.baidu.com/dorachopper/blog/item/3e884bfd3e94a61008244d28.html">阅读全文</a>
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/dorachopper/blog/category/javascript%20%26%2338%3B%26%2338%3B%20web">javascript &#38;&#38; web</a>&nbsp;<a href="http://hi.baidu.com/dorachopper/blog/item/3e884bfd3e94a61008244d28.html#comment">查看评论</a>]]></description>
        <pubDate>2008-08-28  10:24</pubDate>
        <category><![CDATA[javascript &#38;&#38; web]]></category>
        <author><![CDATA[哆啦乔巴]]></author>
		<guid>http://hi.baidu.com/dorachopper/blog/item/3e884bfd3e94a61008244d28.html</guid>
</item>

<item>
        <title><![CDATA[用window.open()代替window.showModalDialog()]]></title>
        <link><![CDATA[http://hi.baidu.com/dorachopper/blog/item/605a343d20f24ec19f3d62f3.html]]></link>
        <description><![CDATA[
		
		<h3> </h3>
<div>
<p><font face="宋体" size="3">来源：JavaEye &nbsp;&nbsp;  作者：ddh9504<br>
</font></p>
<p><font size="3"><font face="宋体"><span style="font-size: 9pt">模式窗口太过于局限性，所以我研究了一个完全可以用</span><span style="font-size: 9pt"><span style="mso-spacerun: yes"> </span></span><span style="font-size: 9pt">window.open()</span><span style="font-size: 9pt">代替</span><span style="font-size: 9pt">window.showModalDialog()</span><span style="font-size: 9pt">的方法，其资料贴在了下面：</span></font></font></p>
<p><font size="3"><font face="宋体"><span style="font-size: 9pt">有两个页面，一个是调用页面</span><span style="font-size: 9pt">---main.html</span><span style="font-size: 9pt">，一个是被调用页面</span><span style="font-size: 9pt">---modalWindow.html</span></font></font></p>
<div style="background-color: #f7efe7">
<div style="background: #fdfdfd"><u>HTML语言</u>: <a href="http://www.fayaa.com/code/view//">main.html</a></div>
<div class="source" style="background-color: #f7efe7" jquery1219829468090="2"><font size="3"><span style="font-weight: bold; color: #000080">&lt;html&gt;</span><br>
<span style="font-weight: bold; color: #000080">&lt;head&gt;</span><br>
<span style="font-weight: bold; color: #000080">&lt;script </span><span style="color: #ff0000">type=</span><span style="color: #0000ff">&quot;text/javascript&quot;</span><span style="font-weight: bold; color: #000080">&gt;</span><br>
<br>
&nbsp;&nbsp;&nbsp;  newWin = <span style="font-weight: bold; color: #000080">null</span>;<br>
&nbsp;&nbsp;&nbsp;  <br>
&nbsp;&nbsp;&nbsp;  <span style="font-weight: bold; color: #000080">function</span> doOpen() {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  newWin = window.open(<span style="color: #0000ff">'modalWindow.html'</span>,<span style="color: #0000ff">'newWin'</span>,<span style="color: #0000ff">'height=200,width=400,top=200,left=200,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no'</span>);<br>
&nbsp;&nbsp;&nbsp;  }<br>
&nbsp;&nbsp;&nbsp;  <br>
&nbsp;&nbsp;&nbsp;  window.onfocus = <span style="font-weight: bold; color: #000080">function</span>() {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  <span style="font-weight: bold; color: #000080">if</span>(newWin) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  <span style="font-weight: bold; color: #000080">if</span>(!newWin.closed) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  newWin.focus();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  }<br>
&nbsp;&nbsp;&nbsp;  }<br>
&nbsp;&nbsp;&nbsp;  <br>
&nbsp;&nbsp;&nbsp;  window.document.onfocus = <span style="font-weight: bold; color: #000080">function</span>() {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  <span style="font-weight: bold; color: #000080">if</span>(newWin) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  <span style="font-weight: bold; color: #000080">if</span>(!newWin.closed) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  newWin.focus();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  }<br>
&nbsp;&nbsp;&nbsp;  }<br>
&nbsp;&nbsp;&nbsp;  <br>
&nbsp;&nbsp;&nbsp;  window.document.onclick = <span style="font-weight: bold; color: #000080">function</span>() {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  <span style="font-weight: bold; color: #000080">if</span>(newWin) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  <span style="font-weight: bold; color: #000080">if</span>(!newWin.closed) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  newWin.focus();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  }<br>
&nbsp;&nbsp;&nbsp;  }<br>
&nbsp;&nbsp;&nbsp;  <br>
&nbsp;&nbsp;&nbsp;  window.document.ondblclick = <span style="font-weight: bold; color: #000080">function</span>() {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  <span style="font-weight: bold; color: #000080">if</span>(newWin) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  <span style="font-weight: bold; color: #000080">if</span>(!newWin.closed) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  newWin.focus();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  }<br>
&nbsp;&nbsp;&nbsp;  }<br>
&nbsp;&nbsp;&nbsp;  <br>
<span style="font-weight: bold; color: #000080">&lt;/script&gt;</span><br>
<br>
<span style="font-weight: bold; color: #000080">&lt;title&gt;</span>main<span style="font-weight: bold; color: #000080">&lt;/title&gt;</span><br>
<span style="font-weight: bold; color: #000080">&lt;/head&gt;</span><br>
<span style="font-weight: bold; color: #000080">&lt;body&gt;</span><br>
&nbsp;&nbsp;&nbsp;  <span style="font-weight: bold; color: #000080">&lt;input</span> <span style="color: #ff0000">type=</span><span style="color: #0000ff">&quot;button&quot;</span> <span style="color: #ff0000">value=</span><span style="color: #0000ff">&quot;Show me&quot;</span> <span style="color: #ff0000">onclick=</span><span style="color: #0000ff">&quot;doOpen();&quot;</span><span style="font-weight: bold; color: #000080">&gt;</span><br>
<span style="font-weight: bold; color: #000080">&lt;/body&gt;</span><br>
<span style="font-weight: bold; color: #000080">&lt;/html&gt;</span><br>
</font></div>
</div>
<div style="background-color: #f7efe7">
<div style="background: #fdfdfd">
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p><font size="3">*************************************************************************************************************</font></p>
<p><font size="3">*************************************************************************************************************</font></p>
<p><font size="3"><u>HTML语言</u>: </font><a href="http://www.fayaa.com/code/view//"><font size="3">modalWindow.html</font></a></p>
</div>
<div class="source" style="background-color: #f7efe7" jquery1219829734300="2"><font size="3"><span style="font-weight: bold; color: #000080">&lt;html&gt;</span><br>
<span style="font-weight: bold; color: #000080">&lt;head&gt;</span><br>
&nbsp;&nbsp;&nbsp;  <span style="font-weight: bold; color: #000080">&lt;title&gt;</span>modalWindow<span style="font-weight: bold; color: #000080">&lt;/title&gt;</span><br>
<span style="font-weight: bold; color: #000080">&lt;/head&gt;</span><br>
<span style="font-weight: bold; color: #000080">&lt;body&gt;</span><br>
&nbsp;&nbsp;&nbsp;  sub window!!!!<br>
<span style="font-weight: bold; color: #000080">&lt;/body&gt;</span><br>
<span style="font-weight: bold; color: #000080">&lt;/html&gt;</span></font></div>
</div>
<p><font size="4"><span style="font-size: 9pt">在这个页面</span><span style="font-size: 9pt"><span style="mso-spacerun: yes"> </span>modalWindow.html<span style="mso-spacerun: yes"> </span></span><span style="font-size: 9pt">中的方法可以调用父窗口的方法</span></font></p>
<p><font size="4"><span style="font-size: 9pt">其用法是</span><span style="font-size: 9pt"> <span>opener.functionName(param);</span></span></font></p>
<p>引文来源&nbsp;&nbsp;<a target="_blank" href="http://www.evget.com/zh-CN/article/2196/default.aspx">真正的用window.open()代替window.showModalDialog() - 慧都控件网</a></p>
</div> <a href="http://hi.baidu.com/dorachopper/blog/item/605a343d20f24ec19f3d62f3.html">阅读全文</a>
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/dorachopper/blog/category/javascript%20%26%2338%3B%26%2338%3B%20web">javascript &#38;&#38; web</a>&nbsp;<a href="http://hi.baidu.com/dorachopper/blog/item/605a343d20f24ec19f3d62f3.html#comment">查看评论</a>]]></description>
        <pubDate>2008-08-27  17:36</pubDate>
        <category><![CDATA[javascript &#38;&#38; web]]></category>
        <author><![CDATA[哆啦乔巴]]></author>
		<guid>http://hi.baidu.com/dorachopper/blog/item/605a343d20f24ec19f3d62f3.html</guid>
</item>


</channel>
</rss>