简体   繁体   English

是否可以使用检索历史(或文档状态)作为浏览器中的导航?

[英]is it possible to use retrieving history (or document state) as a navigation in browser?

I'm worrying that I won't get any reply from stack overflow, because I couldn't get any reply from previous question .我担心我不会从堆栈溢出中得到任何答复,因为我无法从上一个问题中得到任何答复。 You don't need to fully read previous question, but It could be helpful to understand my question.您不需要完全阅读上一个问题,但理解我的问题可能会有所帮助。

Our company is on service that html document builder(windows application) and I'm a desktop s/w engineer.我们公司正在为 html 文档生成器(windows 应用程序)提供服务,我是一名桌面软件工程师。 after build html document with our windows app, we export all things to html/js/css.使用我们的 windows 应用程序构建 html 文档后,我们将所有内容导出到 html/js/css。

Consumer of our application is a designer who creates or edits contents via our windows app.我们应用程序的消费者是通过我们的 Windows 应用程序创建或编辑内容的设计师。 and the end-user of contents which is created by designer see contents via browser(chrome, safari (iphone), samsung browser).由设计师创建的内容的最终用户通过浏览器(chrome、safari(iphone)、三星浏览器)查看内容。

The Problem is, my superior (programmer) wants use java-script as a navigation, this is possible.问题是,我的上级(程序员)想要使用java-script作为导航,这是可能的。 but, he want to save all state of document state before navigation, so after navigation to any page and then comeback to origin page, all state - animation (contents may have animation) and all script state - should be same exactly before he leaving origin page.但是,他想在导航之前保存文档状态的所有状态,因此在导航到任何页面然后返回到原始页面之后,所有状态 - 动画(内容可能有动画)和所有脚本状态 - 在他离开原点之前应该完全相同页。

More specifically, main html has a iframe , and iframe can shows all contents.更具体地说, main html 有一个iframeiframe可以显示所有内容。 Main.html have a navigation button so iframe can navigate all contents created by designer. Main.html有一个导航按钮,因此iframe可以导航设计者创建的所有内容。 If user interacted with page1.html inside iframe , then make iframe to change its content to page2.html by clicking navigation button ( go to second page button implemented inside main.html but outside of iframe ).如果用户在iframe内与page1.html交互,则通过单击导航按钮使iframe将其内容更改为page2.htmlgo to second pagemain.html但在iframe外实现的go to second page按钮)。 and then back to page1.html , he get exactly same state as before he leaving page1.html .然后回到page1.html ,他得到与离开page1.html之前完全相同的状态。

At a glance, It seems quite possible just implement go-forward or go-backward, but dynamically paging navigation is impossible to me.乍一看,似乎很可能只是实现前进或后退,但动态分页导航对我来说是不可能的。 I found some techniques - access browser visit history and window.history object, but It seems there isn't user-defined way.我找到了一些技术 - 访问浏览器visit historywindow.history对象,但似乎没有用户定义的方式。

I thought Electron app(desktop) will be fine for our solution, but my superior says It should be works well with just html/js/css.我认为Electron app(desktop)适合我们的解决方案,但我的上司说它应该只适用于 html/js/css。 Our final product should be shown in desktop, iPad, mobile or any device that handle web browser.我们的最终产品应该在台式机、iPad、移动设备或任何处理网络浏览器的设备上展示。

I need technical advice to accomplish this issue, I'm fine there is no way to control navigation while saving document state.我需要技术建议来解决这个问题,我很好,在保存文档状态时无法控制导航。 Help me please.请帮帮我。

可以通过在 javascript 中使用 localstorage 对象来保存文档状态。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM