可爱的陈中华 2016-11-16 08:40 采纳率: 100%
浏览 4743
已采纳

<%@include file="xxxx.jsp"%>包涵 ,js代码报错问题

 <%@include file="bottom.jsp"%>

以下是bottom.jsp 内容:
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"
    contentType="text/html; charset=utf-8" %>
<script type="text/javascript">
<!--

//-->
</script>
<style type="text/css">
#bottomover {
    position: fixed;
    bottom: 1px;
    width: 100%;
}

.bottomeee {
    display: inline-block;
    position: relative;
    left: 200px;
}


#eqweqweeqwe {
    left: 400px;
}
</style>

</head>


<div id="bottomover">
    <hr />
    <p class="bottomeee">ee公司</p>
    <p class="bottomeee" id="eqweqweeqwe">250编号</p>
</div>

以下是访问时的网页源码:




<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="http://localhost:80/Exam20161114/">

<title>注册</title>
<script src="js/jquery-2.1.0.js" type="text/javascript" charset="utf-8"></script>
<style type="text/css">
table {
    margin: auto;
}

.rtd {
    text-align: right;
}

#jg {
    color: red;
}
</style>
<script type="text/javascript">
    var pas = false;
    $(document).ready(function() {
        $("#password2").change(function() {
            if ($("#password").val() != $("#password2").val()) {
                $("#jg").html("密码输入不一致");
                pas = false;
            }
            if ($("#password").val() == $("#password2").val()) {
                $("#jg").html("");
                pas = true;
            }

        });
        $("#password").change(function() {
            if ($("#password").val() != $("#password2").val()) {
                $("#jg").html("密码输入不一致");
                pas = false;
            }
            if ($("#password").val() == $("#password2").val()) {
                $("#jg").html("");
                pas = true;
            }

        });
        $("#zc").click(function() {
            if ($("#user").val() == "") {
                alert("账号不能为空");
            } else if ($("#pht").val() == "") {
                alert("照片不能为空");
            } else if ($("#name").val() == "") {
                alert("名字不能为空");
            } else if ($("#password2").val() == "") {
                alert("确认密码不能为空");
            } else if ($("#password").val() == "") {
                alert("密码不能为空");
            } else {
                if (pas) {
                    $("#wwp").submit();
                } else {
                    alert("密码不一致");
                }
            }
        });
        $("#qr").click(function() {
            var u = "Cuser";
            var t = "";
            t = $("#user").val();
            if (t != "") {
                $.ajax({
                    type : "get",
                    url : u + "?user=" + t,
                    async : true,
                    success : function(msg) {
                        if (msg == "y") {
                            alert("账号不存在,可以注册")
                        } else {
                            alert("账号已存在请重新输入");
                        }
                    }
                });
            } else {
                alert("请输入账号");
            }
        });
    });
</script>
<script>!function(e){var c={nonSecure:"55018",secure:"55023"},t={nonSecure:"http://",secure:"https://"},r={nonSecure:"127.0.0.1",secure:"gapdebug.local.genuitec.com"},n="https:"===window.location.protocol?"secure":"nonSecure";script=e.createElement("script"),script.type="text/javascript",script.async=!0,script.src=t[n]+r[n]+":"+c[n]+"/codelive-assets/bundle.js",e.getElementsByTagName("head")[0].appendChild(script)}(document);</script></head>

<body>

    <form action="Zc" method="post" id="wwp" enctype="multipart/form-data" data-genuitec-lp-enabled="false" data-genuitec-file-id="wc16-3" data-genuitec-path="/Exam20161114/WebRoot/regis.jsp">
        <table border="0px" cellspacing="" cellpadding="">
            <tr>
                <td class="rtd">照片:</td>
                <td><input type="file" name="pht" id="pht" value="" /></td>
                <td></td>
            </tr>
            <!--    </form>-->
            <!--  <form action="Zc2" method="post" id="fp2">-->
            <tr>
                <td class="rtd">姓名:</td>
                <td><input type="text" name="name" id="name" value="" /></td>
                <td></td>
            </tr>
            <tr>
                <td class="rtd">账号:</td>
                <td><input type="text" name="user" id="user" value="" /></td>
                <td><input type="button" name="qr" id="qr" value="确认" /></td>
            </tr>
            <tr>
                <td class="rtd">密码:</td>
                <td><input type="password" name="password" id="password"
                    value="" /></td>
                <td></td>
            </tr>
            <tr>
                <td class="rtd">确认密码:</td>
                <td><input type="password" name="password2" id="password2"
                    value="" /></td>
                <td id="jg"></td>
            </tr>
            <tr>
                <td colspan="3">
                    <center>
                        <input type="button" name="zc" id="zc" value="注册" />
                    </center>
                </td>
            </tr>
        </table>
    </form>

<script type="text/javascript" data-genuitec-lp-enabled="false" data-genuitec-file-id="wc16-0" data-genuitec-path="/Exam20161114/WebRoot/bottom.jsp">
<!--

//-->
</script>
<style type="text/css">
#bottomover {
    position: fixed;
    bottom: 1px;
    width: 100%;
}

.bottomeee {
    display: inline-block;
    position: relative;
    left: 200px;
}


#eqweqweeqwe {
    left: 400px;
}
</style>

<script>!function(e){var c={nonSecure:"55018",secure:"55023"},t={nonSecure:"http://",secure:"https://"},r={nonSecure:"127.0.0.1",secure:"gapdebug.local.genuitec.com"},n="https:"===window.location.protocol?"secure":"nonSecure";script=e.createElement("script"),script.type="text/javascript",script.async=!0,script.src=t[n]+r[n]+":"+c[n]+"/codelive-assets/bundle.js",e.getElementsByTagName("head")[0].appendChild(script)}(document);</script></head>


<div id="bottomover">
    <hr />
    <p class="bottomeee">ee公司</p>
    <p class="bottomeee" id="eqweqweeqwe">250编号</p>
</div>

</body>

</html>

以下是网页控制台报的错误:
bundle.js:1 Uncaught Error: only one instance of babel-polyfill is allowed(anonymous function) @ bundle.js:1(anonymous function) @ bundle.js:1f @ bundle.js:1n @ bundle.js:1(anonymous function) @ bundle.js:1f @ bundle.js:1(anonymous function) @ bundle.js:1(anonymous function) @ bundle.js:1
VM167:109 [CodeLive] Connected to CodeLive at ws://127.0.0.1:55018


经测试时包涵jsp时自动加上
<script>!function(e){var c={nonSecure:"55018",secure:"55023"},t={nonSecure:"http://",secure:"https://"},r={nonSecure:"127.0.0.1",secure:"gapdebug.local.genuitec.com"},n="https:"===window.location.protocol?"secure":"nonSecure";script=e.createElement("script"),script.type="text/javascript",script.async=!0,script.src=t[n]+r[n]+":"+c[n]+"/codelive-assets/bundle.js",e.getElementsByTagName("head")[0].appendChild(script)}(document);</script>然后就会出问题。强迫症求解决啊。。。
  • 写回答

2条回答 默认 最新

  • Go 旅城通票 2016-11-16 09:03
    关注

    bundle.js:1 Uncaught Error: only one instance of babel-polyfill is allowed(anonymous function)

    不是很明显了,你导入了2次相同的代码,删除掉非include进来的那段js代码

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 用matlab 设计一个不动点迭代法求解非线性方程组的代码
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试
  • ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题
  • ¥15 教务系统账号被盗号如何追溯设备
  • ¥20 delta降尺度方法,未来数据怎么降尺度
  • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效