$("#SpecialAptitude").on("change",function(){CheckType($(this))})$("#SpecialAptitude").on("change",CheckType($(this)))

为什么第一个有效果 第二个没效果呢

实际上两种都是可以的

<!DOCTYPE html>
<html>
<head>
<script src="/jquery/jquery-1.11.1.min.js">
</script>
</head>
<body>
<button>a</button>
<select>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
</select>
<select Id="S2">
<option>a1</option>
<option>a2</option>
<option>a3</option>
<option>a4</option>
</select>
</body>
<script>
$(document).ready(function(){
  $("p").click(function(){
    $(this).hide();
  });
});
function notify() {
  alert( "clicked111" );
}
function notify2() {
  alert( "clicked222" );
}
function notify3() {
  alert( "clicked2223" );
}
$("button").on( "click", notify);
$("select").on( "change", notify2);
$("#S2").on( "change", function(){notify3()});
</script>
</html>

都行

$("#SpecialAptitude").on("change",CheckType($(this)))

只是不能加()

要想加 参数

<!DOCTYPE html>
<html>
<head>
<script src="/jquery/jquery-1.11.1.min.js">
</script>
</head>
<body>
<button>a</button>
<select id="s1">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
</select>
<select Id="S2">
<option>a1</option>
<option>a2</option>
<option>a3</option>
<option>a4</option>
</select>
</body>
<script>
$(document).ready(function(){
  $("p").click(function(){
    $(this).hide();
  });
});
function notify() {
  alert( "clicked111" );
}

$("button").on( "click", notify);
$("#s1").on( "change",{
  name: "Karl"
},notify2);
$("#S2").on( "change", function(){notify3()});
function notify2(a) {
  alert( "clicked222"+a.data.name );
}
function notify3() {
  alert( "clicked2223" );
}
</script>
</html>

随机推荐

  1. bzoj 2468: [中山市选2010]三核苷酸

    2468: [中山市选2010]三核苷酸 Description 三核苷酸是组成DNA序列的基本片段.具体来说,核苷酸一共有4种,分别用’A’,’G’,’C’,’T’来表示.而三核苷酸就是由3个核苷酸 ...

  2. TZOJ 数据结构实验--循环队列

    描述 创建一个循环队列,队列元素个数为4.能够实现队列的初始化.入队列.出队列.求队列长度等操作. 循环队列数据类型定义如下: typedef struct{ int data[Max];    in ...

  3. HDU 5294 Tricks Device 网络流 最短路

    Tricks Device 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5294 Description Innocent Wu follows D ...

  4. Codeforces Round #345 (Div. 2) E. Table Compression 并查集

    E. Table Compression 题目连接: http://www.codeforces.com/contest/651/problem/E Description Little Petya ...

  5. 微信小程序官方文档

    开发手册: https://developers.weixin.qq.com/miniprogram/dev/api/network-file.html 管理后台: https://mp.weixin ...

  6. Ubuntu 16.04安装RedisDesktopManager

    说明:0.9版本的安装补上,只能安装0.8版本的. 官网: https://github.com/uglide/RedisDesktopManager 下载: https://github.com/u ...

  7. [典型漏洞分享]从一个手动分析的反射型XSS漏洞看待一个安全设计原则【中危】

    这是在测试YS“本地相册”功能时发现的一个反射型XSS,自己在安全测试过程中也发现过不少XSS漏洞,唯独这个的发现过程有点区别. 在此之前,我在测试另外一个模块的功能接口的时候发现了一个反射型XSS, ...

  8. NHibernate官方文档中文版--拦截器和事件(Interceptors and events)

    对于应用程序来说,能够对NHibernate内部发生的事件做出响应式很有用的.这能够有助于实现一些类的功能或者扩展NHibernate的功能. 拦截器 IInterceptor接口提供了应用程序ses ...

  9. UTF8

    Here's a couple of functions (based on Brian Bondy's example) that use WideCharToMultiByte and Multi ...

  10. C# base64编码的字符串与图片互转

    protected string ImgToBase64String(string Imagefilename) { try { Bitmap bmp = new Bitmap(Imagefilena ...