简体   繁体   English

jQuery Chrome扩展程序帮助吗?

[英]Jquery Chrome extension help?

I am making a Chrome extensions where you can drag and drop links and it'll bookmark it in the extension. 我正在制作一个Chrome扩展程序,您可以在其中拖放链接,并将其添加到扩展程序中。 I found this from a stackoverflow thread, it does what I want it to but the only problem is that I want it to make a new element with the link and not replace the old link. 我发现从一个计算器线程,它做什么,我也想,但唯一的问题是,我想它做一个新的元素与链接而不是取代旧的链接。 Can someone point me to the right direction. 有人能指出我正确的方向吗? I'm stuck. 我被卡住了。

I modified that fiddle to match your request. 我修改了该小提琴以满足您的要求。 Each dropped link now creates a new LI element within a UL. 现在,每个断开的链接都会在UL中创建一个新的LI元素。 I suggest you read up on the Chrome Bookmark API if you haven't already, and I commented the fiddle to show locations where you would use API functions. 如果您还没有阅读过Chrome书签API,建议您先阅读一下,并在小提琴上加注一下以显示可以使用API​​函数的位置。 If you want to remember which bookmarks the user has created through the extension, you may want to set up localStorage as well to save the ID of the created bookmark. 如果您想记住用户通过扩展名创建了哪些书签,则可能还需要设置localStorage来保存创建的书签的ID。

JSFiddle: http://jsfiddle.net/ArkahnX/jwsdm/5/ JSFiddle: http : //jsfiddle.net/ArkahnX/jwsdm/5/

LocalStorage: http://www.kirupa.com/html5/html5_local_storage.htm 本地存储: http ://www.kirupa.com/html5/html5_local_storage.htm

Chrome Bookmarks API:http://code.google.com/chrome/extensions/bookmarks.html Chrome书签API:http://code.google.com/chrome/extensions/bookmarks.html

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

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