未捕获的引用错误:do_login 未在 HTMLButtonElement.onclick 中定义

问题描述 投票:0回答:2
javascript php jquery mysql ajax
2个回答
1
投票

您的

<script>
标签同时具有正文和
src
属性。

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js">
    // This is the body of the script tag
    function do_login() {
        //...
    }
</script>

src
标签的
<script>
属性优先于标签正文(请参阅JavaScript:具有SRC属性的内联脚本?)。所以这意味着你的
do_login
函数实际上从未被定义:(

尝试将其更改为

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" />
<script type="text/javascript">
    function do_login() {
        //...
    }
</script>

0
投票

未捕获的运行时错误: × 错误 求解未定义 ReferenceError:解决未定义 在 HTMLButtonElement.onclick (http://localhost:3000/?first=rama.1%40gmail.com&password=ram123:33:25)

© www.soinside.com 2019 - 2024. All rights reserved.