2009年10月22日

有时候,需要屏蔽一个div中所有的input类型,使用jquery很简单有效的完成。

jquery 扩展函数:

<script type="text/javascript">  

  (function($) {
        $.fn.disable = function() {
            /// <summary>
            ///  屏蔽所有元素           

            /// </summary>
            /// <returns type="jQuery" />

            return $(this).find("*").each(function() {
                $(this).attr("disabled", "disabled");
            });
        }

        $.fn.enable = function() {
            /// <summary>
            ///  使得所有元素都有效

            /// </summary>
            /// <returns type="jQuery" />

        return $(this).find("*").each(function() {
         $(this).removeAttr("disabled");
            });
        }
    })(jQuery);

 </script>

 

使用方式:装载立即屏蔽:

<script type="text/javascript">  

    $(document).ready(function() {
    $("#div_test").disable();
    });
 </script>

结果不是很美观,但是还是蛮有效。

当然美观的方式是在上面建立一个图层进行屏蔽。

posted @ 2009-10-22 13:10 一路向北 阅读(393) 评论(0) 编辑
 

在windows上使用xampp搭建php的开发环境,后来又安装了oracle 10g。

你会发现,由于oracle 10g 建立了“perl5lib”的环境变量路径,从而导致xampp启动apache的时候报错:

[Thu Oct 22 08:56:27 2009] [error] Can't load Perl file: C:/xampp/apache/conf/extra/startup.pl for server localhost:80, exiting...

有2种解决方法:

1、重新配置好perl5lib环境变量,这种方法可能有些麻烦;

2、更简单的方法是:

找到apache\conf\extra\perl.conf文件,增加一行为:

LoadFile "C:/xampp/perl/bin/perl510.dll"
LoadModule perl_module modules/mod_perl.so
PerlSwitches -T
PerlPostConfigRequire "C:/xampp/apache/conf/extra/startup.pl"

 

 

其中PerlSwitches -T 参数-T的意思为检查perl所在路径。

 

posted @ 2009-10-22 09:13 一路向北 阅读(158) 评论(0) 编辑