ZK iframe browser history problem

asked 2014-10-15 17:07:47 +0800

eclipse2 gravatar image eclipse2
17 4

updated 2014-10-25 03:49:27 +0800

neillee gravatar image neillee flag of Taiwan
1692 1 5

Dear Zk Team,

When I change the iframe src, one entry in browser history is added. Is this behavior correct?

I made one simple fiddle with my use case : http://zkfiddle.org/sample/2uo7g7d/1-Iframe-src-browser-history-problem

I have one menu, that changes the src of one iframe and sets one bookmark in desktop.

When I change the iframe src clicking in the menu, in history of the browser is added 2 new states. One has the previous iframe src, and the second has the new iframe src. This problem causes one failure when clicking back in browser and one failure in welcome label syncronisation.

I'm doing something wrong or is this one issue?


delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted

answered 2014-10-25 04:00:57 +0800

neillee gravatar image neillee flag of Taiwan
1692 1 5

Yes, that is the correct behavior. If you have a static iframe that has a src value initially, then this initial value is not placed into the browser's history, but the successive changes to the static iframe's src are placed into the history.

See this article for more detail.

If you don't want the extra bookmark added when setting iframe's src, the trick is to call iframe.invalidate() after setting the src.

See example

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

1 follower



Asked: 2014-10-15 17:07:47 +0800

Seen: 16 times

Last updated: Oct 25 '14

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More