0

I have a mybb forum, and a plugin that adds a public/private chat to the bottom of the forum (it adds a div before </body>).

I would like to navigate the forum without reloading the chat.

In this question, Josh Stodola explains how to change the url. In this question, there is a small JavaScript code to change the url. I've also read about HTML5 iframes, but I still can't imagine how can I use it all together.

Should the chat be inside an iframe? an iframe inside the forum? should the forum be inside an iframe, and the chat into another? And those 2 iframes, inside a new page???

I'm messed up...

Community
  • 1
  • 1
Salvatorelab
  • 10,675
  • 6
  • 49
  • 74
  • You should use `FRAMESET` and `FRAME` instead of `IFRAME` if you want to achieve that. – Jay Sep 30 '12 at 00:35

1 Answers1

1

You should have a window containing chat and an iframe for your content. This will allow you to navigate your forum and only reload the iframe vs the top frame.

<body><iframe src="someurl"></iframe><div>Chat</div></body>

A few things to note: doing it this way will not change the address bar while you navigate and this makes users confused when they try to link to pages and it takes them to the home page or wherever they started browsing your forum.

If you want to do something more fancy checkout pjax. It will let you change urls for the whole page while only loading certain content.

Tyler Scott
  • 1,006
  • 14
  • 32
  • Oh and if you'd like an example of pjax in use look at github itself. Tree navigation is done via pjax so only the code is swapped out vs reloading the whole page. – Tyler Scott Sep 30 '12 at 08:14
  • thanks, I've found that iframes are not going to help, because I need the chat to stay over the forum. And you can't add layers over a frame, for security reasons. – Salvatorelab Oct 01 '12 at 09:12