为什么在单击提交按钮时将表单字段ID填充为JavaScript变量?

问题描述

考虑以下代码:

$file = Read-Host 'What is the location and name of the file you want to transfer?'
$location = Read-Host 'What is the location you want to set it to?'
# Showing command about to be run
Write-Host "adb push $file $location"
# pausing before running command
pause
adb push $file $location

<html> <head> <script src="https://code.jquery.com/jquery-3.5.1.js"></script> <script> $(document).ready(function() { $("#submitBtn").on("click",function(e) { console.log(911,a); e.preventDefault(); }) }); </script> </head> <body> <form> <input type="text" id="a" /> <button type="submit" id="submitBtn">Submit</button> </form> </body> </html>变量从未明确定义或初始化,但是它具有一个值并引用HTML元素。为什么呢?

基于以下问题:When inserting data to database using JavaScript Error creates in console 'Maximum call stack size exceeded'

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)