如下的html,为什么每次输出都是5,而不是点击每个p,就alert出对应的1,2,3,4,5
闭包演示
function init() {
var pAry = document.getElementsByTagName("p");
for( var i=0; i<pAry.length; i+...
分类:
编程语言 时间:
2014-06-22 22:19:05
阅读次数:
229
这里只讲述http{}模块下的配置:
在ngx_http_block()函数内(这个函数别调用时在ngx_inti_cycle内的ngx_conf_parse函数,这个函数遇到http命令时 回调ngx_http_block,开启http{}配置块的解读工作),针对每一个http模块,调用init_conf之后,有调用了ngx_http_merge_servers()。这是为何!
...
分类:
其他好文 时间:
2014-06-22 20:34:44
阅读次数:
204
自由拖动的DIV层方块
#draggable{
background-color:green;
font-size:9pt;
padding:30px;
color:white;
width:360px;
height:224px;
position:absolute;
}
var rDrag = {
o:null,
init:function(o){
o.onmoused...
分类:
其他好文 时间:
2014-06-22 19:28:18
阅读次数:
292
在swift中,继承是区分类与其他对象的基本特征
继承后的子类可以重写父类的方法,包括类方法和实例方法,属性和附属脚本(subscript)
在继承过程中,构造器方法init()是不被继承的,需要显示标明
class Tandem: Bicycle {
init() {
super.init()
maxPassengers = 2
} }
子类只可以修改从父类继承来的变量属性,而...
分类:
其他好文 时间:
2014-06-22 19:21:28
阅读次数:
159
作为一个web服务器,那么肯定是有监听套接字的,这个监听套接字是用于接收HTTP请求的,这个监听套接字的创建是根据配置文件的内容来创建的,在nginx.conf文件中有多少个地址就需要创建多少个监听套接字。这里不说各个结构体的构造 只说大体情况!
1)、首先在main函数中调用了ngx_init_cycle()函数,在这个函数的最后调用了ngx_open_listening_sockets函...
分类:
其他好文 时间:
2014-06-22 16:45:32
阅读次数:
139
在写自定义的view时,有时会报以下错误:
Caused by: java.lang.NoSuchMethodException: [class android.content.Context, interface android.util.AttributeSet]
android:id="@id/viewpage_container"...
分类:
移动开发 时间:
2014-06-22 15:46:23
阅读次数:
608
在使用md5函数之前要先安装openssl,以及libssl-dev。
包含头文件:#include
两种方式:
第一种:
int MD5_Init(MD5_CTX *c);
int MD5_Update(MD5_CTX *c, const void *data, size_t len);
int MD5_Final(unsigned char *md, MD5_CTX *c);...
分类:
系统相关 时间:
2014-06-22 15:37:03
阅读次数:
1261
今天在ubuntu上遇见这个问题。应该是我的第一分区太小了。
解决办法:
bey0nd@wzw:/var$ cd /var
bey0nd@wzw:/var$ rm -rf log
我们删除日志文件
bey0nd@wzw:/var$ /etc/init.d/mysql start
在开启mysql就正常了...
分类:
数据库 时间:
2014-06-21 23:58:25
阅读次数:
416
这个函数做了连部分工作:1)以端口为入口点 将有用的信息存放到hash表内 2)调用ngx_http_init_listening()函数 对端口进行监听
1、 在ngx_http_core_main_conf_t结构体中有一个字段为ports,是一个数组,数组内存放的全是ngx_http_conf_port_t;对于每一个端口信息(ngx_http_conf_port_t),调用
ngx_h...
分类:
其他好文 时间:
2014-06-21 21:16:25
阅读次数:
267
header("Content-type: image/png");
$im = @imagecreatetruecolor(282, 282) or die("Cannot Initialize new GD image stream");
imagecopy($im, imagecreatefrompng('C02D9CE4B4B6E3F6DF8D9DB734.png'), 1,1,0,0,2...
分类:
Web程序 时间:
2014-06-21 20:01:39
阅读次数:
854