[英]Can someone tell me what this small chunk of js code is doing?
I program in different languages, but not in javascript. 我用不同的语言编程,但不使用javascript。 I can kind of tell what the code in the rest of the program is doing, but I don't understand this part.
我可以说出程序其余部分中的代码在做什么,但是我不理解这一部分。 If anybody can help me out that would be great.
如果有人可以帮助我,那就太好了。
log: {
content: "<div id='exp1_div'></div><div id='exp2_div'></div><div id='exp3_div'></div>",
onLoad: function() {
$('#exp1_div').html("Experiment 1: " + log["exp1"]);
$('#exp2_div').html("Experiment 2: " + log["exp2"]);
$('#exp3_div').html("Experiment 3: " + log["exp3"]);
},
keyHandler: doNothing
}
Someone claims that I broke their program. 有人声称我破坏了他们的程序。 What the program is supposed to do is finish an experiment and write the results in a log file.
该程序应该做的是完成一个实验,并将结果写入日志文件。 I fixed everything else, but I can't figure out the log file part.
我修复了所有其他问题,但无法弄清楚日志文件部分。 Ie where is the log file?
即日志文件在哪里? What is the name of the log file?
日志文件的名称是什么? Etc.
等等。
content: "<div id='exp1_div'></div><div id='exp2_div'></div><div id='exp3_div'></div>"
It is creating 3 div's exp1_div, exp_2_div, exp3_div. 它正在创建3 div的exp1_div,exp_2_div,exp3_div。
$('#exp1_div').html("Experiment 1: " + log["exp1"]);
It is then selecting the individual div and filling its inner HTML with a corresponding entry from an array (not listed in this snippet). 然后,它选择单个div,并用数组中相应的条目填充其内部HTML(此代码段中未列出)。 The array has elements "exp1", "exp2", and "exp3".
该数组具有元素“ exp1”,“ exp2”和“ exp3”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.