嗯... tittle说.在这里,我给你留下链接.我失去了近4个小时试图让它工作!
当我点击按钮时,我想向表中添加行.但它似乎根本没有做任何事情.
<table class="table table-bordered">
<thead>
<tr>
<th>Relation</th>
<th>Column1</th>
<th>Column2</th>
<th>Column3</th>
<th>Column4</th>
<th>Column5</th>
</tr>
</thead>
<tbody id = 'FamilyTable'>
</tbody>
</table>
<button onclick ="AddRow()" type="button" class="btn btn-primary">Add</button>
Run Code Online (Sandbox Code Playgroud)
和JavaScript代码.
function AddRow()
{
var Row = '<tr>'.
'<td>Data</td>'.
'<td>Data</td>'.
'<td>Data</td>'.
'<td>Data</td>'.
'<td>Data</td>'.
'<td>Data</td>'.
'</tr>';
$(Row).appendTo("#FamilyTable");
}
Run Code Online (Sandbox Code Playgroud) 我是node.js和javascript的新手,并试图学习这些东西.在我的测试中,我需要通过select查询从Oracle DB中选择一个值,并且需要稍后将其用于我的代码.我指的是https://blogs.oracle.com/opal/entry/introducing_node_oracledb_a_node上给出的相同代码,它工作正常,但无法返回结果值.
下面是我的代码:
this.getTableData = function(){
var res;
oracledb.getConnection(
{
user : "user",
password : "password",
connectString : "db "
},
function (err, connection) {
if (err) {
console.error(err);
console.log("errorrrrrrrrrrr : "+err);
return;
}
connection.execute("SELECT query",
function(err, result) {
if (err) {
console.error(err);
return;
}
else if(result) {
res = result.rows[0][0];
console.log("result in else if: "+res);
return res;
}});
});
};
Run Code Online (Sandbox Code Playgroud)
该函数返回未定义的值.
在javascript中的ajax响应无效后,在新选项卡中打开,
尝试使用_newtab和_blank
但他们都没有工作,
我说,
有没有解决方案可以得到答案?