为什么是responseText输出?
问题描述:
形式使用按钮提交事件: <button type="button" name="submit">SEARCH</button>
这里是很简单的JavaScript我到目前为止,我不明白为什么它应该在警告被输出表单页面箱:
$(document).ready(function() {
$("button[name='submit']").click(function(){
//
});
});
产生一个警告框,readyState的,状态文本,并responseText的:
200 , OK, <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
(...and the entire html output of the form page goes here...)
</body>
</html>
我不明白为什么我的js应该输出任何东西,如果我没有告诉它。
答
事实证明,我打电话给我的另一个javascript,它有一个相同的$(document).ready(function
脚本部分。即使<button name='submit']
是相同的,所以我的JavaScript很困惑,只是抛出了状态码和responsetext。
什么是表单动作属性值? – Dhiraj
@DhirajBodicherla,为什么行动价值很重要?我不认为这与问题有关。请解释它为什么会是?我还没有提交提交动作。 – TARKUS
我最初并不理解这个问题。现在我知道了。操作属性不相关。 – Dhiraj