问题是这样的,看代码
for(var i=0;i<data.rows.length;i++){
html+="<ul class='ullist'><li class='lilist'>" +
"<a style='cursor:pointer' onclick=noticeList("+data.rows[i]")
+<span style='font-size:12; color:#F00'>new</span></li></ul>" ;//data.rows[i].id 是有值的
}function noticeList(data){
alert(data.id)
}
现在这个alert(data.id)不出来,说少了个"] "
很是郁闷,请Js高手帮帮忙..
for(var i=0;i<data.rows.length;i++){
html+="<ul class='ullist'><li class='lilist'>" +
"<a style='cursor:pointer' onclick=noticeList("+data.rows[i]")
+<span style='font-size:12; color:#F00'>new</span></li></ul>" ;//data.rows[i].id 是有值的
}function noticeList(data){
alert(data.id)
}
现在这个alert(data.id)不出来,说少了个"] "
很是郁闷,请Js高手帮帮忙..
解决方案 »
- ext中groupstore分组下拉
- 求最全的jquery全选,取消一个选择,全选不选中,子项选中,全选选中
- (大家来试试)最简洁的浏览器判断语句
- 如何得到一个页面的有多少<input type="text>的控件数目,并把其输入值存入数组.
- 有没有办法给 String 定义一个类似 length 的属性
- 能否在当前页面设置窗口的高宽,控制菜单栏工具栏的显示。就像window.open,但是不用window.open
- 我只是想写一个可以自动登陆校园网的脚本,但是每次服务器总是返回信息NULLPOINTEREXCEPTION,也不知道我的编的出了出了什么问题,大家帮
- 如何用JavaScript实现在线编辑表格--在線等!
- 一个小小的问题,送上20分
- 一个字符串的简单问题
- 获取页面对象的问题
- 急~~~~~如何使用下拉列表框改变颜色 修改代码
改成 "<a style='cursor:pointer' onclick=noticeList("+data.rows[i] + ")
少了个+号吧
"<a style='cursor:pointer' onclick=noticeList("+data.rows[i] +")
<span style='font-size:12; color:#F00'>new</span></li></ul>" ;
function noticeList(data){
alert(data.id)
}
方法里面怎样获取data.id的值。
html+="<ul class='ullist'><li class='lilist'>" +
"<a style='cursor:pointer' onclick=noticeList("+data.rows[i]")
+<span style='font-size:12; color:#F00'>new</span></li></ul>" ;//data.rows[i].id 是有值的
}在这里面我弹一个alert(data.rows(i));
值为[object object]
MyAjax.easyPost("pems/indexmanager/notebook/loadPerformaceListByIndex.do", {}, function(data) {
var html="";
var xx=$("#loadPerform");
if(data.rows.length>0){
for(var i=0;i<data.rows.length;i++){
html+="<ul class='ullist'><li class='lilist'>" +
"<a style='cursor:pointer' onclick=performanList("+data.rows[i].id+",'"+data.rows[i].symbol+"','"+data.rows[i].content+"','"+data.rows[i].title+"')>"+data.rows[i].title+"</a>" +
"<span style='font-size:12; color:#F00'>new</span></li></ul>" ;
}
xx.html(html);
if(data.records>6){
xx.append("<ul class='ullist'><li class='lilist'><a style='cursor:pointer;' onmouseover='this.className=\"ahover\"' onmouseout='this.className=\"over\"' onclick=nextPagePrc("+data.page+")><<</a> " +
"<a style='cursor:pointer;margin-left:360px' onmouseover='this.className=\"ahover\"' onmouseout='this.className=\"over\"' onclick=onPagePrc("+data.page+")>>></a></li></ul>");
} }
},null,null);
)};function noticeList(data){
var r= ("pems/indexmanager/notebook/notice_list.jsp?id="+data.id+"&title="+data.title+"&content="+data.content+"&startTime="+data.startTime+"&endTime="+data.endTime);
var b=encodeURI(r);
var c=encodeURI(b);
jQuery.FrameDialog
.create({
url: c,
title: '公告明细',
width:550,
height:340,
buttons:{
'确定':function() {
$(this).dialog("close");
},
'取消':function() {
$(this).dialog("close");
}
}
}) }
要么 就直接 取 id :
... onclick='noticeList(\"" + data.rows[i].id + "\");' > ..."function noticeList(sID){
alert(sID)
}