简体   繁体   English

客户端报价计算器

[英]Client-Side Quote Calculator

I'm building a quote calculator that makes all the calculations client side with Javascript, and then if the person wishes to go ahead with the quote, all the information they've entered will be copied from the list structure into a form and submitted via PHP. 我正在建立一个报价计算器,使所有计算都使用Javascript客户端,然后,如果该人希望继续报价,他们输入的所有信息将从列表结构复制到表单中,并通过PHP。

Is it likely that there will be any issues that will cause the browser to freeze during this process, causing the user to refresh and lose all of the details they've entered? 是否有任何问题会导致浏览器在此过程中冻结,从而导致用户刷新并丢失他们输入的所有详细信息?

The reason I'm worried about freezing is because parts of the quote calculator will include JSON requests for Google Maps API v3 services, and I think that increases the chances of getting non responsive webpages. 我担心冻结的原因是,报价计算器的一部分将包含对Google Maps API v3服务的JSON请求,并且我认为这增加了获取无响应网页的机会。

If there are potential issues, how can I plan to avoid them best? 如果存在潜在问题,我该如何计划最好地避免它们?

Is there a way to save the details they enter without an active server connection, in case they have to refresh, I'm thinking probably a cookie? 有没有一种方法可以保存他们输入的详细信息而无需活动的服务器连接,以防万一必须刷新,我想可能是cookie?

  1. JSON requests to Google Maps **can** result in freezing screens/unresponsive pages, but this problem unfortunately cannot be minimized because it depends on the client's browser or computer speed, as that is quite a heavyweight request. 对Google Maps的JSON请求**可能会导致屏幕冻结/页面无响应,但是不幸的是,由于依赖于客户端的浏览器或计算机速度,这个问题无法最小化,因为这是一个重量级的请求。
  2. A cookie is a good idea for temporarily saving data that they've entered, but you will have to set it when they do something on the page, like pressing a submit button. Cookie是暂时保存他们输入的数据的一个好主意,但是当他们在页面上执行某些操作(例如按提交按钮)时,您将必须对其进行设置。 Bear in mind also that the cookie will not become active until the page is refreshed or another page is navigated to. 还请记住,在刷新页面或导航到另一页面之前,cookie不会变为活动状态。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM