0
こんにちは私はこれは非常に単純な質問かもしれないと思うが、私はどこでも答えを見つけることができません。全体のページの代わりに表の1つのセルにJavascript
私は私のデータベースから情報を引き出し、私はそれがアップテーブルの一つのセルにあることを取得しようとしていますが、それは全体のページへ
出力されるJavaScript関数を持っていますHTML
<tr>
<td class="tg-baqh" id='Emp1'></td>
<td class="tg-yw4l"><input type="text" placeholder="enter shift" class="form-control" id='shiftInput'></td>
<td class="tg-yw4l"><input type="text" placeholder="enter shift" class="form-control" id='shiftInput'></td>
<td class="tg-yw4l"><input type="text" placeholder="enter shift" class="form-control"></td>
<td class="tg-yw4l"><input type="text" placeholder="enter shift" class="form-control"></td>
<td class="tg-yw4l"><input type="text" placeholder="enter shift" class="form-control"></td>
<td class="tg-yw4l"><input type="text" placeholder="enter shift" class="form-control"></td>
<td class="tg-yw4l"><input type="text" placeholder="enter shift" class="form-control"></td>
<td class="tg-yw4l">30/16</td>
Javascriptを
$(function Emp1(){
// Get a database reference to our posts
var employeeref = new Firebase("https://shiftsapp.firebaseio.com/employees/emp1");
// Attach an asynchronous callback to read the data at our posts reference
employeeref.on("value", function(snapshot) {
console.log(snapshot.val());
document.write(snapshot.val());
}, function (errorObject) {
console.log("The read failed: " + errorObject.code);
});
});
これはドキュメントの上書きですか? – adeneo
ここから画像を削除し、質問の一部としてコード自体を投稿する必要があります。 – ManoDestra
@ManoDestraコードを追加して画像を取り除きました。 – kelliehughesspare