addEventListener 有三个参数:第一个参数表示事件名称(不含
on,如 “click”);第二个参数表示要接收事件处理的函数;第三个参数为 useCapture。例子如下:
点击我
javascript">
var obj=document.getElementsByTagName("button")[0];
function fun(){
alert(0);
...
分类:
编程语言 时间:
2014-08-19 16:33:35
阅读次数:
226
#include
#define N 16
typedef struct
{ char num[10];
int s;
} STREC;
void fun( STREC a[] )
{
int i,j;
STREC t;
for(i=1;i<N;i++)
for(j=0;j<N-1;j++)
if(a[j].s<a[j+1].s)
{t=a[j]...
分类:
其他好文 时间:
2014-08-19 12:56:54
阅读次数:
169
#include
int fun(int x)
{ int n, s1, s2, s3, t;
n=0;
t=100;
while(t<=999){
s1=t%10; s2=(t/10)%10; s3=t/100;
if(s1+s2+s3==x)
{ printf("%d ",t);
n++;
}
t++;
}
...
分类:
其他好文 时间:
2014-08-18 23:40:33
阅读次数:
460
#include
void fun (long s, long *t)
{ long sl=10;
s /= 10;
*t = s % 10;
while ( s > 0)
{ s = s/100;
*t = s%10*sl + *t;
sl = sl * 10;
}
}
main()
{ long s, t;...
分类:
其他好文 时间:
2014-08-18 23:40:03
阅读次数:
437
__cdecl程序的压栈方式为C风格__stdcall为PASCAL风格举个例子:(1)C函数Fun1(a,b,c)函数调用时,参数压栈顺序为c,b,a(2)PASCAL函数Fun(a,b,c)函数调用时,参数压栈顺序为a,b,c========================== ...
分类:
其他好文 时间:
2014-08-18 20:26:12
阅读次数:
221
#include
#include
#include
void fun(int *a,int *n)
{
int i,j=0;
for(i=0;i<1000;i++)
if((i%7==0||i%11==0)&&i%77!=0)
a[j++]=i;
*n=j;
}
void main()
{
int aa[1000],n,k;
system("CLS");
fun(aa,&n);...
分类:
其他好文 时间:
2014-08-16 23:52:41
阅读次数:
373
#include
void fun(char *s,int *t);
main()
{
char s[80]="as15dw1zxx1";
int t;
printf("\nThe original string is :%s\n",s);
fun(s,&t);
printf("\nThe result is :%d\n",t);
}
void fun(char *s,int *t)
{...
分类:
其他好文 时间:
2014-08-16 22:32:51
阅读次数:
211
#include
#include
#include
int fun(int *x,int y);
void main()
{
int a=3,b=8;
system("CLS");
printf("%d %d\n",a,b);
b=fun(&a,b);
printf("%d %d\n",a,b);
}
int fun(int *x,int y)
{
int t;
t=*x;
*x...
分类:
其他好文 时间:
2014-08-16 22:31:31
阅读次数:
166
JQuery是一个优秀的Javascript框架,是轻量级的js库,使用jQuery将极大的提高编写javascript代码的效率,,让写出来的代码更加优雅,更加健壮。
学好了jquery,我们相当于站长了巨人的肩膀上。
我将分三篇博客为大家介绍jquery,本篇博客将主要介绍jquery的基本语法、智能感知、选择器和事件。
一、基本语法
$(document).ready(fun...
分类:
Web程序 时间:
2014-08-15 16:03:19
阅读次数:
226
有时,当把c风格的不同字符串去实例化函数模版的同一个模版參数时,在实參演绎的过程中常常会发生意想不到的事情,那就是编译失败,并报错类型不匹配。正如以下的样例一样:#includeusing namespace std;/**匹配測试*/templateint ref_fun(T & t1,T & t...
分类:
其他好文 时间:
2014-08-14 13:57:58
阅读次数:
205