购物车理论 - 更新购物车VS Checkout [英] Shopping Cart Theory - Update cart VS Checkout

查看:121
本文介绍了购物车理论 - 更新购物车VS Checkout的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


我再次转向这个天才社区''寻求一些问题的帮助。我有一个购物车(到目前为止运行良好),我将实现各种AJAX功能。但是,首先我想确保它在javascript不可用时有效。因此,当您在购物车页面上,您可以更新数量,然后单击更新购物车,这将更新总计,并刷新购物车页面,然后您可以结帐。我的问题是:如果没有Javascript,我如何知道用户是否正在尝试更新购物车或结帐?有问题的购物车可在以下网址找到:

Fresno SCORE


您必须将购物车添加到购物车。然后你会看到我正在谈论的购物车页面。


提前致谢!


Greg

Hello,

I once again turn to this community of genius'' for some help with a problem. I''ve got a shopping cart (which is working well so far) that I will be implementing all kinds of AJAX functionality on. However, first I want to make sure it works if javascript is not available. So when your on the shopping cart page, you can update the quantities then click Update Cart, which would update the totals, and refresh the shopping cart page, and then you could checkout. My question is: Without Javascript, how do I know if the user is trying to update the cart, or checkout? The cart in question can be found at:

Fresno SCORE

You have to add a workshop to the cart. Then you will see the cart page I''m talking about.

Thanks in advance!

Greg

推荐答案

我没有访问过该网站,但是你知道,无论何时你在JavaScript中做任何事情,非JavaScript替代方案都需要有意义。使用AJAX,您可以自动更新幕后的内容。否则,只需让他们通过表单发布数据并像处理AJAX一样处理服务器端。
I haven''t visited the site, but so you know, whenever you do anything in JavaScript, the non-JavaScript alternative needs to make sense. With AJAX, you can automatically update things behind the scenes. Otherwise, just have them post the data through a form and handle it server-side just like you would with AJAX.



我没有'没有访问过网站,但是你知道,无论何时你在JavaScript中做任何事情,非JavaScript替代方案都需要有意义。使用AJAX,您可以自动更新幕后的内容。否则,让他们通过表单发布数据并像在AJAX一样处理服务器端。
I haven''t visited the site, but so you know, whenever you do anything in JavaScript, the non-JavaScript alternative needs to make sense. With AJAX, you can automatically update things behind the scenes. Otherwise, just have them post the data through a form and handle it server-side just like you would with AJAX.



这就是我的问题。我知道如何负责任地使用AJAX,这就是为什么我要在没有Javascript的情况下构建它。但我有一个表单,有两个按钮,UPDATE和CHECKOUT。当所有代码都在服务器端完成时,我怎么知道用户想要更新购物车而不是CHECKOUT,反之亦然?


谢谢,


Greg

That is what my question is concerning. I know how to use AJAX responsibly, which is why I''m building it to work without Javascript first. But I have one form, with two buttons, UPDATE and CHECKOUT. How do I know that the user wants to UPDATE the cart rather than CHECKOUT and vice versa, when all the code is done on the server side?

Thanks,

Greg



这就是我的问题。我知道如何负责任地使用AJAX,这就是为什么我要在没有Javascript的情况下构建它。但我有一个表单,有两个按钮,UPDATE和CHECKOUT。当所有代码都在服务器端完成时,我怎么知道用户想要更新购物车而不是CHECKOUT,反之亦然?


谢谢,


Greg
That is what my question is concerning. I know how to use AJAX responsibly, which is why I''m building it to work without Javascript first. But I have one form, with two buttons, UPDATE and CHECKOUT. How do I know that the user wants to UPDATE the cart rather than CHECKOUT and vice versa, when all the code is done on the server side?

Thanks,

Greg



您在提交时检查按钮。如果您为按钮指定了name属性,那么它将像表单的其他元素一样提交。请注意,可以在不单击按钮的情况下提交表单,因此如果没有发送按钮,请将表单中的第一个按钮设置为默认值。

You check for the button upon submission. If you give the button a name attribute, then it will be submitted just like other elements of your form. Be aware that the form can be submitted without clicking a button, so make it so the first button in your form is the default if no button is sent.


这篇关于购物车理论 - 更新购物车VS Checkout的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆