Javascript 在我的apache tomcat中编码时出现运行时错误
我正在尝试将我的数据从MongoDB显示到html。数据在MongoDB中,但不会显示在我的html中。我的代码:Javascript 在我的apache tomcat中编码时出现运行时错误,javascript,mongodb,Javascript,Mongodb,我正在尝试将我的数据从MongoDB显示到html。数据在MongoDB中,但不会显示在我的html中。我的代码: $(document).ready(function(){ $( "#buttonlogin" ).click(function(){ masuklogin(); }); }); function masuklogin(){ var formd
$(document).ready(function(){
$( "#buttonlogin" ).click(function(){
masuklogin();
});
});
function masuklogin(){
var formdata = {
nomortelp : $("#nomortelp").val(),
password : $("#password").val()
};
var Jformdata = JSON.stringify(formdata);
console.log(Jformdata);
$.ajax({
url : "/Dompetku/BankMasuk",
context : document.body,
}).done(function (response){
console.log(response);
console.log("ini kerja");
var table = "";
table += "<table class = 'table'> ";
table += "<thread>";
table += "<tr>";
table += "<th>" + "Username" +"</th>";
table += "<th>" + "Password" +"</th>";
table += "<tr>";
table += "<thread>";
response.forEach(function(BankSinarmas) {
table += "<tr>";
table += "<th>" + BankSinarmas.nomortelp; +"</th>";
table += "<th>" + BankSinarmas.password; +"</th>";
table += "<tr>";
});
table += "</table>";
$(".initable").html(table);
});
}
它不是应该读取masuklogin()
函数而不是masuk()
函数吗?
谢谢你们,我希望你们能帮我。你们知道这段代码是javascript而不是java吗?既然您将该问题标记为java问题:),您知道该代码是javascript而不是java吗?因为您将问题标记为java问题:)
index.js:3 Uncaught ReferenceError: masuk is not defined(anonymous function) @ index.js:3dispatch @ jquery-3.0.0.min.js:5q.handle @ jquery-3.0.0.min.js:5