在Firefox中提交jQuery表单

编程入门 行业动态 更新时间:2024-10-28 09:17:06
本文介绍了在Firefox中提交jQuery表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

请帮我解决一个问题。我有这个代码,用于通过锚点提交表单。

Please, help me with one problem. I have this code, for submitting form via anchor.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="www.w3/1999/xhtml"> <head> <title></title> <script src="js/jquery-1.3.2.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { $("#btnLogout").click(function() { $('#frm').submit(); return false; }); }); </script> </head> <body> <form id="frm" action="/" method="post"> <div> <p> <label for="txtLogin">Login:</label> <input name="txtLogin" /> </p> <div> <a id="btnLogout" href="javascript:void(0)">выход</a> </div> </div> </form> </body> </html>

它适用于IE7,8,Opera和谷歌Chrome,但不适用于FireFox 3.5。 我无法理解为什么它不起作用?

It works fine on IE7,8, Opera and Google Chrome, but does not work on FireFox 3.5. I can not understand why it does not work?

推荐答案

这可能是一个与jQuery无直接关系的FF问题。尝试在动作属性中放置一个文件名,如下所示:

This may be a FF issue not related to jQuery directly. Try putting a filename in the action attribute like this:

<form id="frm" action="/index.html" method="post">

只需确保将index.html更改为您的默认文档。

Just make sure to change index.html to whatever your default document is.

更多推荐

在Firefox中提交jQuery表单

本文发布于:2023-10-07 17:54:06,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1470090.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:表单   Firefox   jQuery

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!