将链接保存到html文件 [英] Save Links to a html File
问题描述
我设计了一个网站。这是简单的HTML网站。在我的投资组合页面中,我列出了许多链接。当用户点击任何一个时,链接的html页面将被打开。还有一个名为bookmarks.html的html文件。我想将点击的链接存储到我的bookmarks.html文件中。我怎样才能做到这一点。每当使用时点击应该存储到我的bookmarks.html中的任何投资组合链接..或者还有其他方法可以做到这一点......
我只想存储一个html文件的链接。以便用户以后也可以使用它...
I have designed one website. It is simple html website. In my portfolio page I have given many links as list. When user will click on any one, the linked html page will be open. There is also one html file named bookmarks.html. I want to store the clicked link to my bookmarks.html file. How can I do this. Whenever use click on any portfolio link that should be stored into my bookmarks.html.. or is there any other way to do this...
I just want to store links to an html file. so that user can use it later also...
推荐答案
您可以使用Google Analytics跟踪点击的链接,但更容易使用某种链接服务器端代码。将一些JavaScript添加到每个链接的onclick事件中,该事件调用处理程序来记录单击的链接,可能在一个简单的数据库中 - SQLite [< a href =https://www.sqlite.org/\"target =_ blanktitle =New Window> ^ ]就足够了。然后你的书签页面可以简单地从那里读取结果。
You could use Google Analytics to track which links are clicked, but easier probably would be to use some kind of server-side code. Add some JavaScript to the onclick event of each link that calls a handler to record the link clicked, perhaps in a simple database - SQLite[^] would suffice. Then your bookmarks page could simply read the results from there.
这篇关于将链接保存到html文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!