无限循环问题:是否可以用“复制此代码以共享”来制作“复制此代码以共享”?里面?
我想制作一个博客,每个人都可以复制博客的 HTML(包含链接、图片和文本)以在自己的博客上共享。我希望他们共享的博客也具有这种“复制和共享”功能,并且当人们从他们的博客复制时,“复制和共享”仍保留在博客中。有道理吗?
我看到的问题是我必须在共享内容中创建一个无限长的“共享此”脚本。不可能。
我可以使用 iframe 来做到这一点,但我认为博客通常不允许 iframe,是吗?
例如:
“请分享此堆栈 溢出问题!复制此 html 并 重新发布到任何地方:"
......显然,我的问题将有一个重新发布的链接。Bla
!我的思想要爆炸了!我无法再解释这一点了!
请有人帮助我理解我想做什么,或者告诉我这是不可能的。
I want to make a blog that everyone can copy the HTML of the blog (which contains links, pics, and text) to share on their own blog. I want the blog that they share to also have this "copy and share" feature and when people copy from their blog, the "copy and share" stays with the blog. Make sense?
The problem I see is that I would have to create an infinity long script of "share this" inside the shared content. Not possible.
I could possibly do this with an iframe, but I don't think blogs usually allow iframes, do they?
For example:
"Please share this stack
overflow question! Copy this html and
repost anywhere:"<iframe src="stackoverflow.com/my_question"></iframe>
... and obviously, my question would then have a link to repost it.
Bla! My mind is going to explode! I can't explain this anymore!
Someone please help me understand what I want to do, or tell me it's impossible. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您将“共享此”设为一个按钮,该按钮使用 javascript 显示一个框(用 DIV 制作),其中包含要复制/粘贴的 HTML。
该框应包含您需要共享的所有内容。然后包括用于共享的按钮和 Javascript。这样,当他们复制并粘贴要共享的代码时,它们还包含“共享此按钮”,
无需无限递归。
You make the "Share this" a button, that with javascript shows a box (made with a DIV) with the HTML to copy/paste.
The box should then include everything you need to share. That then includes the button and Javascript for sharing. That way when they copy and paste the code to share, they also include the "Share this button"
No infinite recursion needed.