This post is very helpful for me to send small bits of information across iframes. However, this creates a new challenge with history manager that uses the same mechanism to store page state. Whenever an iframe uses fragment identifiers to send a message across iframes, the page state for the target iframe is wiped out. If the message leads to a new page state, this actually matches the intended use of history manager. However, for scenarios where the message does not lead to a new page state, it may lead to an inconsistent sate between the representation in the URL and what’s displayed on the target iframe. One work around is to reset or synchronize the page state for such use cases, which can generate unnecessary reload/AJAX calls. If you have a cleaner approach, let me know.
Posts Tagged ‘HistoryManager’
Here is a workaround that I figured out. Since URL encoded text has “%” characters, I look for this character. If it exists, do the decoding. If not, skip decoding. Here is a simple sample code:
var input = mystate_information; if(input.indexOf('%') != -1) input = aDecodeFunction(mystate_information)
Do you know of a corner case that this might not work? Or do you have a smarter idea?