js onclick事件传参讲解

时间:2013-11-06    点击:144   

1、在页面中给方法传参数有两种方法

第一:onclick=cancel(id,patientId);

在js文件中定义cancel方法

如果要把当前对象传过去用onclick="cancel(this,id,patientId)"

js中cancel(obj,id,patientId)

第二:在js中用jquery$(function(){

var patientId=$("a").attr("patientId");

}),在页面中<tr patientId="${patientId}">

2、onclick事件

jQuery Mobile 导航栏代码
js将json格式内容转换成对象的方法
Javascript delete 引用类型对象
理解Javascript闭包
Javascript 命名空间模式
> 返回     
地址:上海市普陀区胶州路941号长久商务中心 电话: QQ:
© Copyright 2012 上海网络 Product All Rights Reserved