让jQuery的AJAX有一个非JavaScript(非Ajax)回退?有一个、AJAX、jQuery、JavaScript

2023-09-10 16:15:29 作者:深海时光和你

我已经得到了我的最新项目所做的工作了相当多的,但是我已经意识到有一个有点问题:如果你没有一个JavaScript的浏览器,你不能提交,因为任何形式的每一个表单使用AJAX来提交。

I've gotten a fair amount of work done on my latest project, but I've realized there's a bit of a problem: If you don't have a Javascript-enabled browser, you can't submit any forms because every form uses AJAX to submit it.

我的问题给大家: 我怎样才能实现某种形式的回退,所以,如果没有启用他们的Javascript,他们仍然可以提交表单。

My question to you all: How can I implement some sort of "fallback" so that if they don't have Javascript enabled, they can still submit the form.

目前我有沿,上面写着为最佳(和最优,是指实际工作)的标题横幅体验,请在浏览器中启用Javascript。但是,似乎是小于的最佳解决方案。

Currently I have a banner along the header that says "For the optimal (and by "optimal," we mean "actually working") experience, please enable Javascript in your browser." but that seems like less than the optimal solution.

谢谢!

推荐答案

有关表格,您需要提供方法和行动属性包含您输入的表单标签。然后,实际上使通过一个提交按钮提交那里。一旦这样的作品,然后用jQuery的覆盖它。等瞧。

For a form, you need to supply method and action attributes to the form tag that contains your inputs. Then actually make it submit there via a submit button. Once that works, then override it with your jquery. Et voila.

这是有关进步的网络天大的事情,你可以开发,没有JavaScript的工作页面。解决任何问题的一个切实可行的办法是找出你所需要做的,如果你从来没有使用过JS摆在首位。

This is the big thing about progressive web, you can develop pages that work without javascript. One practical way to solve any problem is to figure out what you'd have needed to do if you never used JS in the first place.

许多开发人员那里不信你甚至应该有一个后备虽然...它似乎是一个热​​门的意识形态争论。

Many developers out there don't believe you should even have a fallback though... its seems to be a hot ideological debate.

 
精彩推荐
图片推荐