我无法在iframe中进行聊天,以便在用户更改页面时恢复内容

时间:2021-03-24 19:31:24

I have a chat that displays in an iframe in my site. Chat is running in chat.A.com (a different server) and my site is in A.com. I am displaying the chat in A.com by using an iframe (iframe.src = "chat.A.com"). When user changes page, the chat reloads and start from beginning. I have tried getting the contentdocument of the original iframe and trying to write it to another iframe and it still refreshes. Have anyone dealt with something like this before?

我的聊天显示在我网站的iframe中。聊天在chat.A.com(另一台服务器)中运行,我的网站在A.com中。我正在使用iframe(iframe.src =“chat.A.com”)在A.com中显示聊天。当用户更改页面时,聊天会重新加载并从头开始。我尝试获取原始iframe的contentdocument并尝试将其写入另一个iframe,但仍然会刷新。有没有人以前处理过这样的事情?

Thanks everyone!

1 个解决方案

#1


0  

Your chat backend would have to load the old chat and fill it into the iframe when it loads, you can't carry the content around with you as they navigate through the frontend.

您的聊天后端必须加载旧聊天并在加载时将其填充到iframe中,当您浏览前端时,您无法随身携带内容。

#1


0  

Your chat backend would have to load the old chat and fill it into the iframe when it loads, you can't carry the content around with you as they navigate through the frontend.

您的聊天后端必须加载旧聊天并在加载时将其填充到iframe中,当您浏览前端时,您无法随身携带内容。