我想保存所有由PHP本身生成的onBlur CodeMirrors。这就是我要说的:
while ($db_field = mysql_fetch_assoc($result)) {
...
var editor = CodeMirror.fromTextArea(document.getElementById("id'.$db_field['id'].'"), {
lineNumbers: true,
matchBrackets: true,
mode: "application/x-httpd-php",
onBlur: id'.$db_field['id'].'.save()
});
...
}但它不能工作...FireBug说:"id1没有定义“...该怎么做呢?
发布于 2011-10-05 22:52:15
我在我的代码中发现了错误:
var id'.$db_field['id'].' = CodeMirror.fromTextArea(document.getElementById("id'.$db_field['id'].'"), {
lineNumbers: true,
matchBrackets: true,
mode: "application/x-httpd-php",
onBlur: function(){
id'.$db_field['id'].'.save();
},
onChange: function(){
$("#changeimg").show();
}
});这就像一种护身符。
https://stackoverflow.com/questions/7548295
复制相似问题