6

Loading different HTML pages in a main HTML page using HTML5 Websockets

 2 years ago
source link: https://www.codesd.com/item/loading-different-html-pages-in-a-main-html-page-using-html5-websockets.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Loading different HTML pages in a main HTML page using HTML5 Websockets

advertisements

i have a situation where i want to load different webpages in a browser where the URL will be passed over the web-sockets.
Now the problem is, if inside one html page which is connected to the sockets server, it receives a command to redirect to another url, the socket connection is lost and it is not possible for the new page unless it has this socket functionality built in it.
One idea is to use a main page with inlineFrame where i keep changing the pages while main page remains connected to the socket server.
I want to know, is there more efficient way of doing this task where i am supposed to received url commands over the socket but idea is to avoid iFrames??


It sounds like your main page is acting like a web browser. It gets a new URL and then loads a real page based on that. You need something to maintain state and control which page is loading and the only way to maintain state with WebSockets is to keep that page open and the connection established.

The only solution I can see is the IFRAME one that you have suggested.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK