Douban.init_rec_btn = function(g) {
var c = $(g).attr("name").split("-"),
b = "/j/recommend",
e = "rdialog-" + c[1] + "-" + c[2],
d = function() {
var h = ((c[1] == "I") && (c[2] == undefined)) ? $("input", $(g).parent())[0].value: c[2],
j = (c[3] == undefined) ? "": c[3],
f = function(l) {
if (l == "I") {
var k = $(".text", "#dialog");
if (k.length) {
if (k[0].value.length) {
k[1].focus()
} else {
k[0].focus()
}
}
} else {
$("#dialog").find(":submit").focus()
}
if ($(g).hasClass("novote")) {
$("form", "#dialog").append('<input name="novote" value="1" type="hidden"/>')
}
};
if ($("#" + e).length) {
show_dialog($("#" + e).html());
load_event_monitor("#dialog");
f(c[1])
} else {
$.getJSON(b, {
type: c[1],
uid: h,
rec: j
},
function(k) {
show_dialog(k.html);
if (c[1] != "I") {
var l = $('<div id="' + e + '"></div>');
l.html(k.html).appendTo("body").hide()
}
load_event_monitor("#dialog");
f(c[1])
})
}
return false
};
$(g).click(d);
if (c[1] == "I") {
$(g).parent().parent().submit(d)
}
};
var c = $(g).attr("name").split("-"),
b = "/j/recommend",
e = "rdialog-" + c[1] + "-" + c[2],
d = function() {
var h = ((c[1] == "I") && (c[2] == undefined)) ? $("input", $(g).parent())[0].value: c[2],
j = (c[3] == undefined) ? "": c[3],
f = function(l) {
if (l == "I") {
var k = $(".text", "#dialog");
if (k.length) {
if (k[0].value.length) {
k[1].focus()
} else {
k[0].focus()
}
}
} else {
$("#dialog").find(":submit").focus()
}
if ($(g).hasClass("novote")) {
$("form", "#dialog").append('<input name="novote" value="1" type="hidden"/>')
}
};
if ($("#" + e).length) {
show_dialog($("#" + e).html());
load_event_monitor("#dialog");
f(c[1])
} else {
$.getJSON(b, {
type: c[1],
uid: h,
rec: j
},
function(k) {
show_dialog(k.html);
if (c[1] != "I") {
var l = $('<div id="' + e + '"></div>');
l.html(k.html).appendTo("body").hide()
}
load_event_monitor("#dialog");
f(c[1])
})
}
return false
};
$(g).click(d);
if (c[1] == "I") {
$(g).parent().parent().submit(d)
}
};
加这个东西干什么
g这个参数的c[1],c[2],c[3]是什么
k[0],k[1]是什么
添加这个是为了from post数据取值用g这个参数的c[1],c[2],c[3] 是g这个参数的name属性通过‘-’分组的数组的值var k = $(".text", "#dialog");
k[0]是class为text的控件
k[1]是id为dialog的控件
添加这个是为了from post数据取值用
能不能说得再详细一些