Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/mongodb/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在我的apache tomcat中编码时出现运行时错误_Javascript_Mongodb - Fatal编程技术网

Javascript 在我的apache tomcat中编码时出现运行时错误

Javascript 在我的apache tomcat中编码时出现运行时错误,javascript,mongodb,Javascript,Mongodb,我正在尝试将我的数据从MongoDB显示到html。数据在MongoDB中,但不会显示在我的html中。我的代码: $(document).ready(function(){ $( "#buttonlogin" ).click(function(){ masuklogin(); }); }); function masuklogin(){ var formd

我正在尝试将我的数据从MongoDB显示到html。数据在MongoDB中,但不会显示在我的html中。我的代码:

$(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