简体   繁体   English

jQuery自动完成标记新标记设计模式

[英]jQuery autocomplete tagging new tag design pattern

I'm trying to create a tagging like system in my application. 我试图在我的应用程序中创建一个类似系统的标签。 This would seem to be a common design pattern but I'm not finding much in the way of examples when it comes to storing new tags from input. 这似乎是一种常见的设计模式,但是在存储来自输入的新标签时,我在示例中找不到太多。 Specifically I'm trying to find the most elegant way of storing new tags in the database from the user submitted input. 具体来说,我正在尝试从用户提交的输入中找到最优雅的方式来在数据库中存储新标签。 So an example from the jQuery UI multiple remotes page. 因此,从jQuery UI多遥控器页面中获得一个示例。

Western Jackdaw, New Tag, Eurasian Wryneck, Another New Tag

What is the most efficient way of inserting the new tags in the database? 在数据库中插入新标签的最有效方法是什么? I want to do more actions on the new tags after the insert so I need to have a response for any tags that are new. 插入后,我想对新标签执行更多操作,因此我需要对新标签进行响应。

It seems like there are two ways to approach this. 似乎有两种方法可以解决此问题。 One would be to do a js object solution client side that would designate whether a tag is from the server or new when the form is submitted. 一种方法是做一个js对象解决方案客户端,该客户端将在提交表单时指定标签是来自服务器还是来自服务器。 The second would be to just submit the tags and let the server figure it out. 第二种方法是只提交标签,然后让服务器确定。

Thanks. 谢谢。

I am not sure but see this URL. 我不确定,但是看到此URL。 I think it help full to you. 我认为这对您有很大帮助。

https://github.com/jstayton/jquery-marcopolo https://github.com/jstayton/jquery-marcopolo

Example

http://jstayton.github.com/jquery-marcopolo/example1.html http://jstayton.github.com/jquery-marcopolo/example1.html

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

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