<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>蒋志新.com</title>
	<atom:link href="http://www.jiangzhixin.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.jiangzhixin.com</link>
	<description>专注WEB开发</description>
	<pubDate>Tue, 18 Nov 2008 15:04:10 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>用isset()和empty()测试变量状态</title>
		<link>http://www.jiangzhixin.com/web/phpmysql/isset_empty.html</link>
		<comments>http://www.jiangzhixin.com/web/phpmysql/isset_empty.html#comments</comments>
		<pubDate>Thu, 13 Nov 2008 14:38:48 +0000</pubDate>
		<dc:creator>老蒋</dc:creator>
		
		<category><![CDATA[PHP+Mysql]]></category>

		<guid isPermaLink="false">http://www.jiangzhixin.com/?p=206</guid>
		<description><![CDATA[isset()测试变量是否被设定为non-null， 而empty()则是测试变量值是否等于false．... ]]></description>
			<content:encoded><![CDATA[<p>isset()测试变量是否被设定为non-null， 而empty()则是测试变量值是否等于false．</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jiangzhixin.com/web/phpmysql/isset_empty.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>利用gettype(),print_r(),var_dump()调试</title>
		<link>http://www.jiangzhixin.com/web/phpmysql/gettype_dump.html</link>
		<comments>http://www.jiangzhixin.com/web/phpmysql/gettype_dump.html#comments</comments>
		<pubDate>Thu, 13 Nov 2008 14:34:30 +0000</pubDate>
		<dc:creator>老蒋</dc:creator>
		
		<category><![CDATA[PHP+Mysql]]></category>

		<guid isPermaLink="false">http://www.jiangzhixin.com/?p=202</guid>
		<description><![CDATA[ＰＨＰ内置的调试函数　gettype();print_r();var_dump();
gettype()返回的名称仅可作为参考信息．
要有计划地检测变量类型，应该选用：
is_int();is_float();is_bool();is_string();is_array();is_object();... ]]></description>
			<content:encoded><![CDATA[<p>ＰＨＰ内置的调试函数　gettype();print_r();var_dump();<br />
gettype()返回的名称仅可作为参考信息．<br />
要有计划地检测变量类型，应该选用：<br />
is_int();is_float();is_bool();is_string();is_array();is_object();</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jiangzhixin.com/web/phpmysql/gettype_dump.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>JS大小错误原来不报错</title>
		<link>http://www.jiangzhixin.com/web/javascript/js_error.html</link>
		<comments>http://www.jiangzhixin.com/web/javascript/js_error.html#comments</comments>
		<pubDate>Wed, 12 Nov 2008 09:07:47 +0000</pubDate>
		<dc:creator>老蒋</dc:creator>
		
		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.jiangzhixin.com/?p=200</guid>
		<description><![CDATA[今天用jquery做个二级级联..在本地测试都OK,上传到服务器后总是不行.
最后才发现,原来写JS的时候弄错了一个大小写.本地是 win 环境,所以OK.
服务器是UNIX,所以不行..
唉.以后一定要小心小心再小... ]]></description>
			<content:encoded><![CDATA[<p>今天用jquery做个二级级联..在本地测试都OK,上传到服务器后总是不行.</p>
<p>最后才发现,原来写JS的时候弄错了一个大小写.本地是 win 环境,所以OK.</p>
<p>服务器是UNIX,所以不行..</p>
<p>唉.以后一定要小心小心再小心.养成严格区分大小心的好习惯</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jiangzhixin.com/web/javascript/js_error.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>PHP变量</title>
		<link>http://www.jiangzhixin.com/web/phpmysql/php_var.html</link>
		<comments>http://www.jiangzhixin.com/web/phpmysql/php_var.html#comments</comments>
		<pubDate>Mon, 10 Nov 2008 13:50:16 +0000</pubDate>
		<dc:creator>老蒋</dc:creator>
		
		<category><![CDATA[PHP+Mysql]]></category>

		<guid isPermaLink="false">http://www.jiangzhixin.com/?p=198</guid>
		<description><![CDATA[1.变量　（所有的变量都必须以$开头）
2.引用变量(可以为变量创建某种别名，改变该别名的值也会改变原变量的值)
3.超全局变量 superglobal
&#60;?php
$myvar=0;
$yourvar=&#34;This is my value&#34;;
$myvar=&#34;Th... ]]></description>
			<content:encoded><![CDATA[<p>1.变量　（所有的变量都必须以$开头）</p>
<p>2.引用变量(可以为变量创建某种别名，改变该别名的值也会改变原变量的值)</p>
<p>3.超全局变量 superglobal</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">&lt;?php</li>
<li>$myvar=0;</li>
<li>$yourvar=&quot;This is my value&quot;;</li>
<li>$myvar=&quot;This is my value&quot;;</li>
<li>echo $yourvar;</li>
<li>&nbsp;</li>
<li>$myvar=&amp;$yourvar;</li>
<li>$myvar=&quot;This is now my value.&quot;;</li>
<li>echo $yourar;</li>
<li>&nbsp;</li>
<li>//This is my value</li>
<li>//This is now my value</li>
<li>?&gt;</li></ol></div>
]]></content:encoded>
			<wfw:commentRss>http://www.jiangzhixin.com/web/phpmysql/php_var.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>又去长城了．累啊．～～</title>
		<link>http://www.jiangzhixin.com/z7z8/sbjj/changcheng1.html</link>
		<comments>http://www.jiangzhixin.com/z7z8/sbjj/changcheng1.html#comments</comments>
		<pubDate>Mon, 10 Nov 2008 08:20:11 +0000</pubDate>
		<dc:creator>老蒋</dc:creator>
		
		<category><![CDATA[随便记记]]></category>

		<guid isPermaLink="false">http://www.jiangzhixin.com/?p=195</guid>
		<description><![CDATA[
又去长城了．累啊．～～... ]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.jiangzhixin.com/wp-content/uploads/2008/11/dsc00787.jpg"><img src="http://www.jiangzhixin.com/wp-content/uploads/2008/11/dsc00787-300x224.jpg" alt="" title="又上长城啦" width="300" height="224" class="alignnone size-medium wp-image-194" /></a></p>
<p>又去长城了．累啊．～～</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jiangzhixin.com/z7z8/sbjj/changcheng1.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>最近几天的记录整理</title>
		<link>http://www.jiangzhixin.com/web/phpmysql/lltt_1109_2.html</link>
		<comments>http://www.jiangzhixin.com/web/phpmysql/lltt_1109_2.html#comments</comments>
		<pubDate>Sun, 09 Nov 2008 16:14:18 +0000</pubDate>
		<dc:creator>老蒋</dc:creator>
		
		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[PHP+Mysql]]></category>

		<category><![CDATA[榴莲糖糖]]></category>

		<guid isPermaLink="false">http://www.jiangzhixin.com/?p=192</guid>
		<description><![CDATA[1.关于命名．最好使用骆驼用名法，function尽量不要使用下划线．变量要用下划线
2.你在windows下面不区分大小写可以正常运行 但你也得保证你的程序在linux下面也能正常运行．写ＰＨＰ也要区别... ]]></description>
			<content:encoded><![CDATA[<p>1.关于命名．最好使用骆驼用名法，function尽量不要使用下划线．变量要用下划线<br />
2.你在windows下面不区分大小写可以正常运行 但你也得保证你的程序在linux下面也能正常运行．写ＰＨＰ也要区别大小写．<br />
3. PHP的学习思路　php，你再学半年就差不多了。接下来就是设计模式和思想了．还给我推荐了两本书《php5范例代码查询辞典》，《php &#038;mysql web数据库应用开发指南》.我马上在网上订购了．呵<br />
4.tp的路由设置<br />
5. 搞web的人，不学js，等于是废物。呵呵，所以又给我推荐了一本书＜＜javascript权威指南＞＞．还有一个超牛的js游戏示例http://www.xgate.net.cn/cg/<br />
6.写法也要注意。尽量不要在一行里，或者一个逻辑片段，或者函数里，做2件事。<br />
<?php<br />
$a=3;<br />
$b=5;<br />
echo "$a+$b".=$a+$b;<br />
／／输出来的结果是8?而不是3+5=8<br />
?></p>
<p>7.其实你只要记住一点。任何一个类，或者函数，不管放到哪都能直接用，就ok<br />
1个函数只做一件事。为什么现在写类要讲究松耦合，其实也是这个道理。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jiangzhixin.com/web/phpmysql/lltt_1109_2.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>今天开个栏目来整理和榴莲糖糖的聊天记录</title>
		<link>http://www.jiangzhixin.com/z7z8/lltt/lltt_110.html</link>
		<comments>http://www.jiangzhixin.com/z7z8/lltt/lltt_110.html#comments</comments>
		<pubDate>Sun, 09 Nov 2008 16:01:17 +0000</pubDate>
		<dc:creator>老蒋</dc:creator>
		
		<category><![CDATA[榴莲糖糖]]></category>

		<guid isPermaLink="false">http://www.jiangzhixin.com/?p=190</guid>
		<description><![CDATA[最近几天和榴莲糖聊天．学了不少东西．好东西需要整理和分享．今天开始我要记录下来．．... ]]></description>
			<content:encoded><![CDATA[<p>最近几天和榴莲糖聊天．学了不少东西．好东西需要整理和分享．今天开始我要记录下来．．</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jiangzhixin.com/z7z8/lltt/lltt_110.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>如何去掉index.php呢</title>
		<link>http://www.jiangzhixin.com/web/thinkphp/tp_index_php.html</link>
		<comments>http://www.jiangzhixin.com/web/thinkphp/tp_index_php.html#comments</comments>
		<pubDate>Fri, 07 Nov 2008 15:06:01 +0000</pubDate>
		<dc:creator>老蒋</dc:creator>
		
		<category><![CDATA[thinkPHP]]></category>

		<guid isPermaLink="false">http://www.jiangzhixin.com/?p=188</guid>
		<description><![CDATA[去除URL中的index.php
例如你的原路径是 http://localhost/test/index.php/index/add
那么现在的地址是 http://localhost/test/index/add
如何去掉index.php呢
1.httpd.conf配置文件中加载了mod_rewrite.so模块
2.AllowOverride None ... ]]></description>
			<content:encoded><![CDATA[<p>去除URL中的index.php<br />
例如你的原路径是 http://localhost/test/index.php/index/add<br />
那么现在的地址是 http://localhost/test/index/add<br />
如何去掉index.php呢</p>
<p>1.httpd.conf配置文件中加载了mod_rewrite.so模块<br />
2.AllowOverride None 讲None改为 All<br />
3.确保URL_MODEL设置为2，<br />
4 .htaccess文件必须放到跟目录下<br />
<IfModule mod_rewrite.c><br />
RewriteEngine on<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]<br />
</IfModule></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jiangzhixin.com/web/thinkphp/tp_index_php.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>js日历控件介绍及使用详解</title>
		<link>http://www.jiangzhixin.com/web/javascript/time_js.html</link>
		<comments>http://www.jiangzhixin.com/web/javascript/time_js.html#comments</comments>
		<pubDate>Sun, 02 Nov 2008 12:16:26 +0000</pubDate>
		<dc:creator>老蒋</dc:creator>
		
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.jiangzhixin.com/?p=186</guid>
		<description><![CDATA[一个项目中，很多时候我们都需要选择时间的功能，一种能够将时间格式统一化的方法对于数据存储来说额为重要，然而使用一般文本框的形式或者下拉框的形式来完成这个功能的话就会比较... ]]></description>
			<content:encoded><![CDATA[<p>一个项目中，很多时候我们都需要选择时间的功能，一种能够将时间格式统一化的方法对于数据存储来说额为重要，然而使用一般文本框的形式或者下拉框的形式来完成这个功能的话就会比较繁琐，那么如何来用一个简单方法来实现这个功能呢，最理想的方式当然是使用日历控件了！<br />
使用以下方法将会让你的程序减少不少麻烦，而且很美观哦！^ _ ^</p>
<p>首先，想使用日历，当然需要一个js日历控件了，新建一个Calendar.js文件（有了这个文件，以后想使用时调用以下就可以了，超方便），加入以下代码：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">&lt;!--</li>
<li>var cal;</li>
<li>var isFocus=false; //是否为焦点</li>
<li>//function SelectDate(obj,strFormat) //两个参数改为只传一个</li>
<li>function SelectDate(obj)</li>
<li>{</li>
<li>&nbsp;&nbsp; &nbsp;var date = new Date();</li>
<li>&nbsp;&nbsp; &nbsp;var by = date.getFullYear()-10; //最小值 → 10 年前</li>
<li>&nbsp;&nbsp; &nbsp;var ey = date.getFullYear()+10; //最大值 → 10 年后</li>
<li>&nbsp;&nbsp; &nbsp;cal = (cal==null) ? new Calendar(by, ey, 0) : cal;&nbsp; &nbsp; //初始化为中文版，1为英文版</li>
<li>&nbsp;&nbsp; &nbsp;//cal.dateFormatStyle = strFormat; // 默认显示格式为:yyyy-MM-dd ,还可显示 yyyy/MM/dd</li>
<li>&nbsp;&nbsp; &nbsp;cal.show(obj);</li>
<li>}</li>
<li>/**//* 返回日期 */</li>
<li>String.prototype.toDate = function(style){</li>
<li>var y = this.substring(style.indexOf('y'),style.lastIndexOf('y')+1);//年</li>
<li>var m = this.substring(style.indexOf('M'),style.lastIndexOf('M')+1);//月</li>
<li>var d = this.substring(style.indexOf('d'),style.lastIndexOf('d')+1);//日</li>
<li>if(isNaN(y)) y = new Date().getFullYear();</li>
<li>if(isNaN(m)) m = new Date().getMonth();</li>
<li>if(isNaN(d)) d = new Date().getDate();</li>
<li>var dt ;</li>
<li>eval (&quot;dt = new Date('&quot;+ y+&quot;', '&quot;+(m-1)+&quot;','&quot;+ d +&quot;')&quot;);</li>
<li>return dt;</li>
<li>}</li>
<li>/**//* 格式化日期 */</li>
<li>Date.prototype.format = function(style){</li>
<li>var o = {</li>
<li>&nbsp;&nbsp; &nbsp;&quot;M+&quot; : this.getMonth() + 1, //month</li>
<li>&nbsp;&nbsp; &nbsp;&quot;d+&quot; : this.getDate(),&nbsp; &nbsp; &nbsp; //day</li>
<li>&nbsp;&nbsp; &nbsp;&quot;h+&quot; : this.getHours(),&nbsp; &nbsp; &nbsp;//hour</li>
<li>&nbsp;&nbsp; &nbsp;&quot;m+&quot; : this.getMinutes(),&nbsp; &nbsp;//minute</li>
<li>&nbsp;&nbsp; &nbsp;&quot;s+&quot; : this.getSeconds(),&nbsp; &nbsp;//second</li>
<li>&nbsp;&nbsp; &nbsp;&quot;w+&quot; : &quot;天一二三四五六&quot;.charAt(this.getDay()),&nbsp; &nbsp;//week</li>
<li>&nbsp;&nbsp; &nbsp;&quot;q+&quot; : Math.floor((this.getMonth() + 3) / 3), //quarter</li>
<li>&nbsp;&nbsp; &nbsp;&quot;S&quot; : this.getMilliseconds() //millisecond</li>
<li>}</li>
<li>if(/(y+)/.test(style)){</li>
<li>&nbsp;&nbsp; &nbsp;style = style.replace(RegExp.$1,</li>
<li>&nbsp;&nbsp; &nbsp;(this.getFullYear() + &quot;&quot;).substr(4 - RegExp.$1.length));</li>
<li>}</li>
<li>for(var k in o){</li>
<li>&nbsp;&nbsp; &nbsp;if(new RegExp(&quot;(&quot;+ k +&quot;)&quot;).test(style)){</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp;style = style.replace(RegExp.$1,</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;RegExp.$1.length == 1 ? o[k] :</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;(&quot;00&quot; + o[k]).substr((&quot;&quot; + o[k]).length));</li>
<li>&nbsp;&nbsp; &nbsp;}</li>
<li>}</li>
<li>return style;</li>
<li>};</li>
<li>&nbsp;</li>
<li>/**//*</li>
<li>* 日历类</li>
<li>* @param&nbsp; &nbsp;beginYear 1990</li>
<li>* @param&nbsp; &nbsp;endYear&nbsp; &nbsp;2010</li>
<li>* @param&nbsp; &nbsp;lang&nbsp; &nbsp; &nbsp; 0(中文)|1(英语) 可自由扩充</li>
<li>* @param&nbsp; &nbsp;dateFormatStyle &quot;yyyy-MM-dd&quot;;</li>
<li>*/</li>
<li>function Calendar(beginYear, endYear, lang, dateFormatStyle){</li>
<li>this.beginYear = 1990;</li>
<li>this.endYear = 2010;</li>
<li>this.lang = 0;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //0(中文) | 1(英文)</li>
<li>this.dateFormatStyle = &quot;yyyy-MM-dd&quot;;</li>
<li>&nbsp;</li>
<li>if (beginYear != null &amp;&amp; endYear != null){</li>
<li>&nbsp;&nbsp; &nbsp;this.beginYear = beginYear;</li>
<li>&nbsp;&nbsp; &nbsp;this.endYear = endYear;</li>
<li>}</li>
<li>if (lang != null){</li>
<li>&nbsp;&nbsp; &nbsp;this.lang = lang</li>
<li>}</li>
<li>&nbsp;</li>
<li>if (dateFormatStyle != null){</li>
<li>&nbsp;&nbsp; &nbsp;this.dateFormatStyle = dateFormatStyle</li>
<li>}</li>
<li>&nbsp;</li>
<li>this.dateControl = null;</li>
<li>this.panel = this.getElementById(&quot;calendarPanel&quot;);</li>
<li>this.container = this.getElementById(&quot;ContainerPanel&quot;);</li>
<li>this.form = null;</li>
<li>&nbsp;</li>
<li>this.date = new Date();</li>
<li>this.year = this.date.getFullYear();</li>
<li>this.month = this.date.getMonth();</li>
<li>&nbsp;</li>
<li>&nbsp;</li>
<li>this.colors = {</li>
<li>&quot;cur_word&quot;&nbsp; &nbsp; &nbsp; : &quot;#FFFFFF&quot;, //当日日期文字颜色</li>
<li>&quot;cur_bg&quot;&nbsp; &nbsp; &nbsp; &nbsp; : &quot;#83A6F4&quot;, //当日日期单元格背影色</li>
<li>&quot;sel_bg&quot;&nbsp; &nbsp; &nbsp; &nbsp; : &quot;#FFCCCC&quot;, //已被选择的日期单元格背影色</li>
<li>&quot;sun_word&quot;&nbsp; &nbsp; &nbsp; : &quot;#FF0000&quot;, //星期天文字颜色</li>
<li>&quot;sat_word&quot;&nbsp; &nbsp; &nbsp; : &quot;#0000FF&quot;, //星期六文字颜色</li>
<li>&quot;td_word_light&quot; : &quot;#333333&quot;, //单元格文字颜色</li>
<li>&quot;td_word_dark&quot; : &quot;#CCCCCC&quot;, //单元格文字暗色</li>
<li>&quot;td_bg_out&quot;&nbsp; &nbsp; &nbsp;: &quot;#EFEFEF&quot;, //单元格背影色</li>
<li>&quot;td_bg_over&quot;&nbsp; &nbsp; : &quot;#FFCC00&quot;, //单元格背影色</li>
<li>&quot;tr_word&quot;&nbsp; &nbsp; &nbsp; &nbsp;: &quot;#FFFFFF&quot;, //日历头文字颜色</li>
<li>&quot;tr_bg&quot;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;: &quot;#666666&quot;, //日历头背影色</li>
<li>&quot;input_border&quot; : &quot;#CCCCCC&quot;, //input控件的边框颜色</li>
<li>&quot;input_bg&quot;&nbsp; &nbsp; &nbsp; : &quot;#EFEFEF&quot;&nbsp; &nbsp;//input控件的背影色</li>
<li>}</li>
<li>&nbsp;</li>
<li>this.draw();</li>
<li>this.bindYear();</li>
<li>this.bindMonth();</li>
<li>this.changeSelect();</li>
<li>this.bindData();</li>
<li>}</li>
<li>&nbsp;</li>
<li>/**//*</li>
<li>* 日历类属性（语言包，可自由扩展）</li>
<li>*/</li>
<li>Calendar.language ={</li>
<li>&quot;year&quot;&nbsp; &nbsp;: [[&quot;&quot;], [&quot;&quot;]],</li>
<li>&quot;months&quot; : [[&quot;一月&quot;,&quot;二月&quot;,&quot;三月&quot;,&quot;四月&quot;,&quot;五月&quot;,&quot;六月&quot;,&quot;七月&quot;,&quot;八月&quot;,&quot;九月&quot;,&quot;十月&quot;,&quot;十一月&quot;,&quot;十二月&quot;],</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;[&quot;JAN&quot;,&quot;FEB&quot;,&quot;MAR&quot;,&quot;APR&quot;,&quot;MAY&quot;,&quot;JUN&quot;,&quot;JUL&quot;,&quot;AUG&quot;,&quot;SEP&quot;,&quot;OCT&quot;,&quot;NOV&quot;,&quot;DEC&quot;]</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ],</li>
<li>&quot;weeks&quot; : [[&quot;日&quot;,&quot;一&quot;,&quot;二&quot;,&quot;三&quot;,&quot;四&quot;,&quot;五&quot;,&quot;六&quot;],</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;[&quot;SUN&quot;,&quot;MON&quot;,&quot;TUR&quot;,&quot;WED&quot;,&quot;THU&quot;,&quot;FRI&quot;,&quot;SAT&quot;]</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ],</li>
<li>&quot;clear&quot; : [[&quot;清空&quot;], [&quot;CLS&quot;]],</li>
<li>&quot;today&quot; : [[&quot;今天&quot;], [&quot;TODAY&quot;]],</li>
<li>&quot;close&quot; : [[&quot;关闭&quot;], [&quot;CLOSE&quot;]]</li>
<li>}</li>
<li>&nbsp;</li>
<li>Calendar.prototype.draw = function(){</li>
<li>calendar = this;</li>
<li>&nbsp;</li>
<li>var mvAry = [];</li>
<li>mvAry[mvAry.length] = ' &lt;div name=&quot;calendarForm&quot; style=&quot;margin: 0px;&quot;&gt;';</li>
<li>mvAry[mvAry.length] = '&nbsp; &nbsp; &lt;table width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;1&quot;&gt;';</li>
<li>mvAry[mvAry.length] = '&nbsp; &nbsp; &nbsp; &lt;tr&gt;';</li>
<li>mvAry[mvAry.length] = '&nbsp; &nbsp; &nbsp; &nbsp; &lt;th align=&quot;left&quot; width=&quot;1%&quot;&gt;&lt;input style=&quot;border: 1px solid ' + calendar.colors[&quot;input_border&quot;] + ';background-color:' + calendar.colors[&quot;input_bg&quot;] + ';width:16px;height:20px;&quot; name=&quot;prevMonth&quot; type=&quot;button&quot; id=&quot;prevMonth&quot; value=&quot;&amp;lt;&quot; /&gt;&lt;/th&gt;';</li>
<li>mvAry[mvAry.length] = '&nbsp; &nbsp; &nbsp; &nbsp; &lt;th align=&quot;center&quot; width=&quot;98%&quot; nowrap=&quot;nowrap&quot;&gt;&lt;select name=&quot;calendarYear&quot; id=&quot;calendarYear&quot; style=&quot;font-size:12px;&quot;&gt;&lt;/select&gt;&lt;select name=&quot;calendarMonth&quot; id=&quot;calendarMonth&quot; style=&quot;font-size:12px;&quot;&gt;&lt;/select&gt;&lt;/th&gt;';</li>
<li>mvAry[mvAry.length] = '&nbsp; &nbsp; &nbsp; &nbsp; &lt;th align=&quot;right&quot; width=&quot;1%&quot;&gt;&lt;input style=&quot;border: 1px solid ' + calendar.colors[&quot;input_border&quot;] + ';background-color:' + calendar.colors[&quot;input_bg&quot;] + ';width:16px;height:20px;&quot; name=&quot;nextMonth&quot; type=&quot;button&quot; id=&quot;nextMonth&quot; value=&quot;&amp;gt;&quot; /&gt;&lt;/th&gt;';</li>
<li>mvAry[mvAry.length] = '&nbsp; &nbsp; &nbsp; &lt;/tr&gt;';</li>
<li>mvAry[mvAry.length] = '&nbsp; &nbsp; &lt;/table&gt;';</li>
<li>mvAry[mvAry.length] = '&nbsp; &nbsp; &lt;table id=&quot;calendarTable&quot; width=&quot;100%&quot; style=&quot;border:0px solid #CCCCCC;background-color:#FFFFFF&quot; border=&quot;0&quot; cellpadding=&quot;3&quot; cellspacing=&quot;1&quot;&gt;';</li>
<li>mvAry[mvAry.length] = '&nbsp; &nbsp; &nbsp; &lt;tr&gt;';</li>
<li>for(var i = 0; i &lt; 7; i++){</li>
<li>&nbsp;&nbsp; &nbsp;mvAry[mvAry.length] = '&nbsp; &nbsp; &nbsp; &lt;th style=&quot;font-weight:normal;background-color:' + calendar.colors[&quot;tr_bg&quot;] + ';color:' + calendar.colors[&quot;tr_word&quot;] + ';&quot;&gt;' + Calendar.language[&quot;weeks&quot;][this.lang][i] + '&lt;/th&gt;';</li>
<li>}</li>
<li>mvAry[mvAry.length] = '&nbsp; &nbsp; &nbsp; &lt;/tr&gt;';</li>
<li>for(var i = 0; i &lt; 6;i++){</li>
<li>&nbsp;&nbsp; &nbsp;mvAry[mvAry.length] = '&nbsp; &nbsp; &lt;tr align=&quot;center&quot;&gt;';</li>
<li>&nbsp;&nbsp; &nbsp;for(var j = 0; j &lt; 7; j++){</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp;if (j == 0){</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;mvAry[mvAry.length] = ' &lt;td style=&quot;cursor:default;color:' + calendar.colors[&quot;sun_word&quot;] + ';&quot;&gt;&lt;/td&gt;';</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp;} else if(j == 6){</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;mvAry[mvAry.length] = ' &lt;td style=&quot;cursor:default;color:' + calendar.colors[&quot;sat_word&quot;] + ';&quot;&gt;&lt;/td&gt;';</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp;} else{</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;mvAry[mvAry.length] = ' &lt;td style=&quot;cursor:default;&quot;&gt;&lt;/td&gt;';</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp;}</li>
<li>&nbsp;&nbsp; &nbsp;}</li>
<li>&nbsp;&nbsp; &nbsp;mvAry[mvAry.length] = '&nbsp; &nbsp; &lt;/tr&gt;';</li>
<li>}</li>
<li>mvAry[mvAry.length] = '&nbsp; &nbsp; &nbsp; &lt;tr style=&quot;background-color:' + calendar.colors[&quot;input_bg&quot;] + ';&quot;&gt;';</li>
<li>mvAry[mvAry.length] = '&nbsp; &nbsp; &nbsp; &nbsp; &lt;th colspan=&quot;2&quot;&gt;&lt;input name=&quot;calendarClear&quot; type=&quot;button&quot; id=&quot;calendarClear&quot; value=&quot;' + Calendar.language[&quot;clear&quot;][this.lang] + '&quot; style=&quot;border: 1px solid ' + calendar.colors[&quot;input_border&quot;] + ';background-color:' + calendar.colors[&quot;input_bg&quot;] + ';width:100%;height:20px;font-size:12px;&quot;/&gt;&lt;/th&gt;';</li>
<li>mvAry[mvAry.length] = '&nbsp; &nbsp; &nbsp; &nbsp; &lt;th colspan=&quot;3&quot;&gt;&lt;input name=&quot;calendarToday&quot; type=&quot;button&quot; id=&quot;calendarToday&quot; value=&quot;' + Calendar.language[&quot;today&quot;][this.lang] + '&quot; style=&quot;border: 1px solid ' + calendar.colors[&quot;input_border&quot;] + ';background-color:' + calendar.colors[&quot;input_bg&quot;] + ';width:100%;height:20px;font-size:12px;&quot;/&gt;&lt;/th&gt;';</li>
<li>mvAry[mvAry.length] = '&nbsp; &nbsp; &nbsp; &nbsp; &lt;th colspan=&quot;2&quot;&gt;&lt;input name=&quot;calendarClose&quot; type=&quot;button&quot; id=&quot;calendarClose&quot; value=&quot;' + Calendar.language[&quot;close&quot;][this.lang] + '&quot; style=&quot;border: 1px solid ' + calendar.colors[&quot;input_border&quot;] + ';background-color:' + calendar.colors[&quot;input_bg&quot;] + ';width:100%;height:20px;font-size:12px;&quot;/&gt;&lt;/th&gt;';</li>
<li>mvAry[mvAry.length] = '&nbsp; &nbsp; &nbsp; &lt;/tr&gt;';</li>
<li>mvAry[mvAry.length] = '&nbsp; &nbsp; &lt;/table&gt;';</li>
<li>mvAry[mvAry.length] = ' &lt;/div&gt;';</li>
<li>this.panel.innerHTML = mvAry.join(&quot;&quot;);</li>
<li>&nbsp;</li>
<li>var obj = this.getElementById(&quot;prevMonth&quot;);</li>
<li>obj.onclick = function (){calendar.goPrevMonth(calendar);}</li>
<li>obj.onblur = function (){calendar.onblur();}</li>
<li>this.prevMonth= obj;</li>
<li>&nbsp;</li>
<li>obj = this.getElementById(&quot;nextMonth&quot;);</li>
<li>obj.onclick = function (){calendar.goNextMonth(calendar);}</li>
<li>obj.onblur = function (){calendar.onblur();}</li>
<li>this.nextMonth= obj;</li>
<li>&nbsp;</li>
<li>&nbsp;</li>
<li>obj = this.getElementById(&quot;calendarClear&quot;);</li>
<li>obj.onclick = function (){calendar.dateControl.value = &quot;&quot;;calendar.hide();}</li>
<li>this.calendarClear = obj;</li>
<li>&nbsp;</li>
<li>obj = this.getElementById(&quot;calendarClose&quot;);</li>
<li>obj.onclick = function (){calendar.hide();}</li>
<li>this.calendarClose = obj;</li>
<li>&nbsp;</li>
<li>obj = this.getElementById(&quot;calendarYear&quot;);</li>
<li>obj.onchange = function (){calendar.update(calendar);}</li>
<li>obj.onblur = function (){calendar.onblur();}</li>
<li>this.calendarYear = obj;</li>
<li>&nbsp;</li>
<li>obj = this.getElementById(&quot;calendarMonth&quot;);</li>
<li>with(obj)</li>
<li>{</li>
<li>&nbsp;&nbsp; &nbsp;onchange = function (){calendar.update(calendar);}</li>
<li>&nbsp;&nbsp; &nbsp;onblur = function (){calendar.onblur();}</li>
<li>}this.calendarMonth = obj;</li>
<li>&nbsp;</li>
<li>obj = this.getElementById(&quot;calendarToday&quot;);</li>
<li>obj.onclick = function (){</li>
<li>&nbsp;&nbsp; &nbsp;var today = new Date();</li>
<li>&nbsp;&nbsp; &nbsp;calendar.date = today;</li>
<li>&nbsp;&nbsp; &nbsp;calendar.year = today.getFullYear();</li>
<li>&nbsp;&nbsp; &nbsp;calendar.month = today.getMonth();</li>
<li>&nbsp;&nbsp; &nbsp;calendar.changeSelect();</li>
<li>&nbsp;&nbsp; &nbsp;calendar.bindData();</li>
<li>&nbsp;&nbsp; &nbsp;calendar.dateControl.value = today.format(calendar.dateFormatStyle);</li>
<li>&nbsp;&nbsp; &nbsp;calendar.hide();</li>
<li>}</li>
<li>this.calendarToday = obj;</li>
<li>}</li>
<li>&nbsp;</li>
<li>//年份下拉框绑定数据</li>
<li>Calendar.prototype.bindYear = function(){</li>
<li>var cy = this.calendarYear;</li>
<li>cy.length = 0;</li>
<li>for (var i = this.beginYear; i &lt;= this.endYear; i++){</li>
<li>&nbsp;&nbsp; &nbsp;cy.options[cy.length] = new Option(i + Calendar.language[&quot;year&quot;][this.lang], i);</li>
<li>}</li>
<li>}</li>
<li>&nbsp;</li>
<li>//月份下拉框绑定数据</li>
<li>Calendar.prototype.bindMonth = function(){</li>
<li>var cm = this.calendarMonth;</li>
<li>cm.length = 0;</li>
<li>for (var i = 0; i &lt; 12; i++){</li>
<li>&nbsp;&nbsp; &nbsp;cm.options[cm.length] = new Option(Calendar.language[&quot;months&quot;][this.lang][i], i);</li>
<li>}</li>
<li>}</li>
<li>&nbsp;</li>
<li>//向前一月</li>
<li>Calendar.prototype.goPrevMonth = function(e){</li>
<li>if (this.year == this.beginYear &amp;&amp; this.month == 0){return;}</li>
<li>this.month--;</li>
<li>if (this.month == -1){</li>
<li>&nbsp;&nbsp; &nbsp;this.year--;</li>
<li>&nbsp;&nbsp; &nbsp;this.month = 11;</li>
<li>}</li>
<li>this.date = new Date(this.year, this.month, 1);</li>
<li>this.changeSelect();</li>
<li>this.bindData();</li>
<li>}</li>
<li>&nbsp;</li>
<li>//向后一月</li>
<li>Calendar.prototype.goNextMonth = function(e){</li>
<li>if (this.year == this.endYear &amp;&amp; this.month == 11){return;}</li>
<li>this.month++;</li>
<li>if (this.month == 12){</li>
<li>&nbsp;&nbsp; &nbsp;this.year++;</li>
<li>&nbsp;&nbsp; &nbsp;this.month = 0;</li>
<li>}</li>
<li>this.date = new Date(this.year, this.month, 1);</li>
<li>this.changeSelect();</li>
<li>this.bindData();</li>
<li>}</li>
<li>&nbsp;</li>
<li>//改变SELECT选中状态</li>
<li>Calendar.prototype.changeSelect = function(){</li>
<li>var cy = this.calendarYear;</li>
<li>var cm = this.calendarMonth;</li>
<li>for (var i= 0; i &lt; cy.length; i++){</li>
<li>&nbsp;&nbsp; &nbsp;if (cy.options[i].value == this.date.getFullYear()){</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp;cy[i].selected = true;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp;break;</li>
<li>&nbsp;&nbsp; &nbsp;}</li>
<li>}</li>
<li>for (var i= 0; i &lt; cm.length; i++){</li>
<li>&nbsp;&nbsp; &nbsp;if (cm.options[i].value == this.date.getMonth()){</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp;cm[i].selected = true;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp;break;</li>
<li>&nbsp;&nbsp; &nbsp;}</li>
<li>}</li>
<li>}</li>
<li>&nbsp;</li>
<li>//更新年、月</li>
<li>Calendar.prototype.update = function (e){</li>
<li>this.year = e.calendarYear.options[e.calendarYear.selectedIndex].value;</li>
<li>this.month = e.calendarMonth.options[e.calendarMonth.selectedIndex].value;</li>
<li>this.date = new Date(this.year, this.month, 1);</li>
<li>this.changeSelect();</li>
<li>this.bindData();</li>
<li>}</li>
<li>&nbsp;</li>
<li>//绑定数据到月视图</li>
<li>Calendar.prototype.bindData = function (){</li>
<li>var calendar = this;</li>
<li>var dateArray = this.getMonthViewArray(this.date.getFullYear(), this.date.getMonth());</li>
<li>var tds = this.getElementById(&quot;calendarTable&quot;).getElementsByTagName(&quot;td&quot;);</li>
<li>for(var i = 0; i &lt; tds.length; i++){</li>
<li>tds[i].style.backgroundColor = calendar.colors[&quot;td_bg_out&quot;];</li>
<li>&nbsp;&nbsp; &nbsp;tds[i].onclick = function () {return;}</li>
<li>&nbsp;&nbsp; &nbsp;tds[i].onmouseover = function () {return;}</li>
<li>&nbsp;&nbsp; &nbsp;tds[i].onmouseout = function () {return;}</li>
<li>&nbsp;&nbsp; &nbsp;if (i &gt; dateArray.length - 1) break;</li>
<li>&nbsp;&nbsp; &nbsp;tds[i].innerHTML = dateArray[i];</li>
<li>&nbsp;&nbsp; &nbsp;if (dateArray[i] != &quot;&amp;nbsp;&quot;){</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp;tds[i].onclick = function () {</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if (calendar.dateControl != null){</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;calendar.dateControl.value = new Date(calendar.date.getFullYear(),</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;calendar.date.getMonth(),</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;this.innerHTML).format(calendar.dateFormatStyle);</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;calendar.hide();</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp;}</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp;tds[i].onmouseover = function () {</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;this.style.backgroundColor = calendar.colors[&quot;td_bg_over&quot;];</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp;}</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp;tds[i].onmouseout = function () {</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;this.style.backgroundColor = calendar.colors[&quot;td_bg_out&quot;];</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp;}</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp;if (new Date().format(calendar.dateFormatStyle) ==</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;new Date(calendar.date.getFullYear(),</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; calendar.date.getMonth(),</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dateArray[i]).format(calendar.dateFormatStyle)) {</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;tds[i].style.backgroundColor = calendar.colors[&quot;cur_bg&quot;];</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;tds[i].onmouseover = function () {</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;this.style.backgroundColor = calendar.colors[&quot;td_bg_over&quot;];</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;tds[i].onmouseout = function () {</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;this.style.backgroundColor = calendar.colors[&quot;cur_bg&quot;];</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp;}//end if</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp;//设置已被选择的日期单元格背影色</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp;if (calendar.dateControl != null &amp;&amp; calendar.dateControl.value == new Date(calendar.date.getFullYear(),</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; calendar.date.getMonth(),</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dateArray[i]).format(calendar.dateFormatStyle)) {</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;tds[i].style.backgroundColor = calendar.colors[&quot;sel_bg&quot;];</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;tds[i].onmouseover = function () {</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;this.style.backgroundColor = calendar.colors[&quot;td_bg_over&quot;];</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;tds[i].onmouseout = function () {</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;this.style.backgroundColor = calendar.colors[&quot;sel_bg&quot;];</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp;}</li>
<li>&nbsp;&nbsp; &nbsp;}</li>
<li>}</li>
<li>}</li>
<li>&nbsp;</li>
<li>//根据年、月得到月视图数据(数组形式)</li>
<li>Calendar.prototype.getMonthViewArray = function (y, m) {</li>
<li>var mvArray = [];</li>
<li>var dayOfFirstDay = new Date(y, m, 1).getDay();</li>
<li>var daysOfMonth = new Date(y, m + 1, 0).getDate();</li>
<li>for (var i = 0; i &lt; 42; i++) {</li>
<li>&nbsp;&nbsp; &nbsp;mvArray[i] = &quot;&amp;nbsp;&quot;;</li>
<li>}</li>
<li>for (var i = 0; i &lt; daysOfMonth; i++){</li>
<li>&nbsp;&nbsp; &nbsp;mvArray[i + dayOfFirstDay] = i + 1;</li>
<li>}</li>
<li>return mvArray;</li>
<li>}</li>
<li>&nbsp;</li>
<li>//扩展 document.getElementById(id) 多浏览器兼容性 from meizz tree source</li>
<li>Calendar.prototype.getElementById = function(id){</li>
<li>if (typeof(id) != &quot;string&quot; || id == &quot;&quot;) return null;</li>
<li>if (document.getElementById) return document.getElementById(id);</li>
<li>if (document.all) return document.all(id);</li>
<li>try {return eval(id);} catch(e){ return null;}</li>
<li>}</li>
<li>&nbsp;</li>
<li>//扩展 object.getElementsByTagName(tagName)</li>
<li>Calendar.prototype.getElementsByTagName = function(object, tagName){</li>
<li>if (document.getElementsByTagName) return document.getElementsByTagName(tagName);</li>
<li>if (document.all) return document.all.tags(tagName);</li>
<li>}</li>
<li>&nbsp;</li>
<li>//取得HTML控件绝对位置</li>
<li>Calendar.prototype.getAbsPoint = function (e){</li>
<li>var x = e.offsetLeft;</li>
<li>var y = e.offsetTop;</li>
<li>while(e = e.offsetParent){</li>
<li>&nbsp;&nbsp; &nbsp;x += e.offsetLeft;</li>
<li>&nbsp;&nbsp; &nbsp;y += e.offsetTop;</li>
<li>}</li>
<li>return {&quot;x&quot;: x, &quot;y&quot;: y};</li>
<li>}</li>
<li>&nbsp;</li>
<li>//显示日历</li>
<li>Calendar.prototype.show = function (dateObj, popControl) {</li>
<li>if (dateObj == null){</li>
<li>&nbsp;&nbsp; &nbsp;throw new Error(&quot;arguments[0] is necessary&quot;)</li>
<li>}</li>
<li>this.dateControl = dateObj;</li>
<li>&nbsp;</li>
<li>this.date = (dateObj.value.length &gt; 0) ? new Date(dateObj.value.toDate(this.dateFormatStyle)) : new Date() ;//若为空则显示当前月份</li>
<li>this.year = this.date.getFullYear();</li>
<li>this.month = this.date.getMonth();</li>
<li>this.changeSelect();</li>
<li>this.bindData();</li>
<li>if (popControl == null){</li>
<li>&nbsp;&nbsp; &nbsp;popControl = dateObj;</li>
<li>}</li>
<li>var xy = this.getAbsPoint(popControl);</li>
<li>this.panel.style.left = xy.x -25 + &quot;px&quot;;</li>
<li>this.panel.style.top = (xy.y + dateObj.offsetHeight) + &quot;px&quot;;</li>
<li>&nbsp;</li>
<li>this.panel.style.display = &quot;&quot;;</li>
<li>this.container.style.display = &quot;&quot;;</li>
<li>&nbsp;</li>
<li>dateObj.onblur = function(){calendar.onblur();}</li>
<li>this.container.onmouseover = function(){isFocus=true;}</li>
<li>this.container.onmouseout = function(){isFocus=false;}</li>
<li>}</li>
<li>&nbsp;</li>
<li>//隐藏日历</li>
<li>Calendar.prototype.hide = function() {</li>
<li>this.panel.style.display = &quot;none&quot;;</li>
<li>this.container.style.display = &quot;none&quot;;</li>
<li>isFocus=false;</li>
<li>}</li>
<li>&nbsp;</li>
<li>//焦点转移时隐藏日历</li>
<li>Calendar.prototype.onblur = function() {</li>
<li>&nbsp;&nbsp; &nbsp;if(!isFocus){this.hide();}</li>
<li>}</li>
<li>document.write('&lt;div id=&quot;ContainerPanel&quot; style=&quot;display:none;&quot;&gt;&lt;div id=&quot;calendarPanel&quot; style=&quot;position: absolute;display: none;z-index: 9999;');</li>
<li>document.write('background-color: #FFFFFF;border: 1px solid #CCCCCC;width:175px;font-size:12px;margin-left:25px;&quot;&gt;&lt;/div&gt;');</li>
<li>if(document.all)</li>
<li>{</li>
<li>document.write('&lt;iframe style=&quot;position:absolute;z-index:2000;width:expression(this.previousSibling.offsetWidth);');</li>
<li>document.write('height:expression(this.previousSibling.offsetHeight);');</li>
<li>document.write('left:expression(this.previousSibling.offsetLeft);top:expression(this.previousSibling.offsetTop);');</li>
<li>document.write('display:expression(this.previousSibling.style.display);&quot; scrolling=&quot;no&quot; frameborder=&quot;no&quot;&gt;&lt;/iframe&gt;');</li>
<li>}</li>
<li>document.write('&lt;/div&gt;');</li>
<li>//--&gt;</li></ol></div>
<p>然后，在你需要日历控件的页面中调用就可以了，例如我有一张页面aa.html，需要使用日历控件，只需要加入：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">&lt;script src=&quot;Calendar.js&quot; type=&quot;text/javascript&quot; language=&quot;javascript&quot;&gt;&lt;/script&gt;</li>
<li>&lt;input name=&quot;txtDate&quot; type=&quot;text&quot; style=&quot;padding-left:5px;&quot; size=&quot;10&quot; id=&quot;txtDate&quot; onclick=&quot;SelectDate(this)&quot; readonly=&quot;readonly&quot; /&gt;</li></ol></div>
<p>打开aa.html，点击文本框，日历控件便会出现，点击一个日期后，日历控件消失，文本框出现了你选择的日期，而且该日历控件对于最高年限和最低年限可以自行修改，是不是很方便呢~</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jiangzhixin.com/web/javascript/time_js.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>Left Jion 详解</title>
		<link>http://www.jiangzhixin.com/web/phpmysql/left-jion.html</link>
		<comments>http://www.jiangzhixin.com/web/phpmysql/left-jion.html#comments</comments>
		<pubDate>Tue, 28 Oct 2008 03:30:56 +0000</pubDate>
		<dc:creator>老蒋</dc:creator>
		
		<category><![CDATA[PHP+Mysql]]></category>

		<guid isPermaLink="false">http://www.jiangzhixin.com/?p=184</guid>
		<description><![CDATA[用到的数据库表：
mysql> select * from tt;
+&#8212;&#8212;+&#8212;&#8212;+
&#124; id      &#124; name &#124;
+&#8212;&#8212;+&#8212;&#8212;+
&#124;    1    &#124; a    &#124;
&#124;    2    &#124; b    &#124;
&#124;    3    &#124; c    &#124;
+&#8... ]]></description>
			<content:encoded><![CDATA[<p>用到的数据库表：<br />
mysql> select * from tt;<br />
+&#8212;&#8212;+&#8212;&#8212;+<br />
| id      | name |<br />
+&#8212;&#8212;+&#8212;&#8212;+<br />
|    1    | a    |<br />
|    2    | b    |<br />
|    3    | c    |<br />
+&#8212;&#8212;+&#8212;&#8212;+</p>
<p>mysql> select * from tt1;<br />
+&#8212;&#8212;+&#8212;&#8212;+<br />
| id      | name |<br />
+&#8212;&#8212;+&#8212;&#8212;+<br />
|    1    | a    |<br />
|    2    | b    |<br />
|    3    | c    |<br />
+&#8212;&#8212;+&#8212;&#8212;+</p>
<p>操作一：<br />
select * from tt left join tt1 on tt.id=tt1.id   &#8211;提取id相等的</p>
<p>id   name   id   name<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
1   a    1   a<br />
2   b    2   b<br />
3   c    3   c</p>
<p>操作二:<br />
select * from tt left join tt1 on tt.id=tt1.id where tt.id=1<br />
&#8211;用的是where,可以看出用where 和 and 的区别了：）</p>
<p>id   name   id   name<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
1   a     1     a</p>
<p>操作三:<br />
select * from tt left join tt1 on tt.id=tt1.id and tt.id=1<br />
&#8211;用的是and,且是主表tt.id=1</p>
<p>id   name   id   name<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
1   a    1   a<br />
2   b    NULL NULL<br />
3   c    NULL NULL</p>
<p>操作四:这个返回跟上面一样的结果<br />
select * from tt left join tt1 on tt.id=tt1.id and tt1.id=1<br />
&#8211;用的是and,且是从表tt1.id=1</p>
<p>id   name   id   name<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
1   a    1   a<br />
2   b    NULL NULL<br />
3   c    NULL NULL</p>
<p>操作五:<br />
select * from tt left join tt1 on tt.id=1      &#8211;关键是去掉了id相等这个条件</p>
<p>id   name   id   name<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
1   a       1     a<br />
1   a       2     b<br />
1   a       3     c<br />
2   b       NULL NULL<br />
3   c       NULL NULL</p>
<p>很多人不了解，其实left join 嘛, 无非是左边表为基础, 扫描右边表匹配的记录</p>
<p>先是左边表的第1条记录<br />
1    a<br />
按条件 tt.id=1, 来扫描右边表的记录<br />
对于右边表的每条记录, 显然 tt.id=1 这个条件都是成立的, 所以第1条记录匹配后的结果是:</p>
<p>1      a       1        a<br />
1      a       2        b<br />
1      a       3        c</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
然后再扫描第2条记录<br />
2     b<br />
对于条件 tt.id=1, 在表中没有与之匹配的记录, 所以右边表为NULL<br />
因此第2条记录匹配的结果为<br />
2      b       NULL        NULL</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
第3条记录与第2条记录一样, 匹配的结果是<br />
3      c       NULL        NULL</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
因此最终结果是5条记录<br />
1      a       1        a<br />
1      a       2        b<br />
1      a       3        c<br />
2      b       null     null<br />
3      c       null     null</p>
<p>操作六:<br />
select * from tt left join tt1 on tt1.id=1   &#8211;是从表tt1.id=1</p>
<p>id   name   id   name<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
1   a    1   a<br />
2   b    1   a<br />
3   c    1   a</p>
<p>&#8211;解释:上面的结果是这样取的，先取主表1   a，再扫描从表tt1,正好<br />
其第一条数据id=1,满足条件，所以输出:<br />
1   a    1   a<br />
然后再是从表tt1第二条数据 2 b，id!=1,不输出,同理3   c也不满足条件,<br />
再主表 2 b,联立从表第一条数据1 a,满足条件，输出,<br />
以后依次类推&#8230;&#8230;&#8230;&#8230;&#8230;</p>
<p>&#8211;最主要的就是在连接里的 and 和 where 是有本质区别。<br />
1.<br />
select * from a left join b on a.id=b.id where a.id=1<br />
2.<br />
select * from a left join b on a.id=b.id and a.id=1</p>
<p>where里的条件是对连接后的结果集进行筛选，而on里的条件是关联时进行比较用的</p>
<p>&#8211;再看一下更加详细的解释:<br />
1、首先列出笛卡尔乘积<br />
1 a 1 a<br />
1 a 2 b<br />
1 a 3 c<br />
2 b 1 a<br />
2 b 2 b<br />
2 b 3 c<br />
3 c 1 a<br />
3 c 2 b<br />
3 c 3 c</p>
<p>2、对每个左边的纪录，看有没有符合on条件的，如果有，保留符合条件的，去掉不符合条件的，如果没有，<br />
   保留左边和右边是null的一条纪录<br />
1 a 1 a<br />
1 a 2 b<br />
1 a 3 c      &#8211;左边1的都符合都保留<br />
2 b null null &#8211;左边2的都不符合，变成一条右边null的纪录<br />
3 c null null   &#8211;左边3的都不符合，变成一条右边null的纪录</p>
<p>3、再去掉where条件不符合的，就是结果（这里的例子没有where条件，所以结果不变，大家自己可以加条件测试下）<br />
1 a 1 a<br />
1 a 2 b<br />
1 a 3 c<br />
2 b null null<br />
3 c null null</p>
<p>对于left join的on条件：<br />
用左边的记录去匹配右边的每条记录，匹配条件就是on里的条件，若右边有满足条件的记录，则取出来，<br />
若没有匹配的记录，则给个null值，对于其后的where条件，<br />
是对整个left join后产生的结果集进行筛选，所以条件放在on里和where里是完全不同的意思，切记！！！</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jiangzhixin.com/web/phpmysql/left-jion.html/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
