简体   繁体   English

在HTML5中存储用户输入数据

[英]Storing user input data in HTML5

A (possible) client has a multipart questionnaire that they want coded in HTML5 (for responsiveness). (可能的)客户有一个多部分问卷,他们想要用HTML5编码(用于响应)。 I was thinking Bootstrap 3, combined with HTML and a bit o' javascript. 我在想Bootstrap 3,结合HTML和一点点javascript。 However, I don't know what their options are regarding tracking the answers. 但是,我不知道他们在跟踪答案方面的选择是什么。

I'm new to HTML5, coming from the Flash world. 我是HTML5的新手,来自Flash世界。 What are my options? 我有什么选择? It seems a job for a backend DB, and I know enough Django to get into trouble, so perhaps that would be the best bet? 对于后端DB来说这似乎是一项工作,而且我知道Django会遇到麻烦,所以也许这是最好的选择? I have done basic Django sites, but when something goes wrong, oh, it's a bit of a pain! 我已经完成了基本的Django网站,但是当出现问题时,哦,这有点痛苦! (I haven't found Django as user friendly as I might like) (我没有发现Django像我想的那样用户友好)

Is there anything new and funky in HTML5 (I'm not sure how they'd get the data out of local storage)? HTML5中有什么新的和时髦的(我不确定他们如何从本地存储中获取数据)? I'm good at HTML, but don't know all the tricky tricks in HTML5. 我擅长HTML,但不知道HTML5中所有棘手的技巧。

Thanks 谢谢

Use ViewModel with Knockout.js for responsiveness. 将ViewModel与Knockout.js一起使用以获得响应。 Its pretty fast. 它非常快。 You can see this sample Knockout.js project here . 你可以在这里看到这个样本Knockout.js项目。

Have you taken a look at the Django HTML5 Boilerplate (DH5BP) project 1 on GitHub? 你有没有看过GitHub上的Django HTML5 Boilerplate(DH5BP)项目1

From the Readme.md 来自Readme.md

The Django HTML5 Boilerplate...incorporat[es] the HTML5 Boilerplate (H5BP) project into an easy to consume Django-friendly Python package. Django HTML5 Boilerplate ...将HTML5 Boilerplate(H5BP)项目整合到易于使用的Django友好的Python包中。

Find out...about HTML5 Boilerplate at https://github.com/h5bp/html5-boilerplate https://github.com/h5bp/html5-boilerplate上找到关于HTML5 Boilerplate的信息

This project differentiates itself from other H5BP to Django ports, by including Fabric scripts that automatically convert new versions of H5BP into a Django-friendly Python module. 该项目通过包含Fabric脚本自动将新版本的H5BP转换为Django友好的Python模块,从而使自己与其他H5BP到Django端口区别开来。 Ideally, this will make keeping up-to-date with the latest version of H5BP trivial. 理想情况下,这将使最新版本的H5BP变得微不足道。

Your best bet is probably to work with a CMS. 您最好的选择可能是与CMS合作。 It would greatly reduce your development time and it would help you avoid common pit-falls. 这将大大缩短您的开发时间,它可以帮助您避免常见的陷阱。

I would recommend using WordPress with some sort of plugin as in my experience it has been the easiest to work with for small projects. 我建议使用带有某种插件的 WordPress ,因为根据我的经验,这对于小型项目来说是最容易使用的。

HTML5 has some new elements and a simplified syntax. HTML5有一些新元素和简化语法。 Some elements have had their definitions changed (what the tags intended usage is). 一些元素的定义已经改变(标签的用途是什么)。

Update: 更新:

Four years later, WordPress now has a REST API. 四年后,WordPress现在有了一个REST API。 A good way to store user input could be to check if they are logged in and then post information via AJAX to the API. 存储用户输入的一种好方法可能是检查它们是否已登录,然后通过AJAX将信息发布到API。

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

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