v1.53.5 correct postMessage management V01.53.05
authorcavaliet
Wed, 30 Apr 2014 12:32:09 +0200
changeset 1309 de74a8e61df4
parent 1308 1f3ae0cc28a3
child 1310 080f62544792
v1.53.5 correct postMessage management
src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed_iframe.html
--- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed_iframe.html	Wed Apr 30 12:31:24 2014 +0200
+++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed_iframe.html	Wed Apr 30 12:32:09 2014 +0200
@@ -23,8 +23,8 @@
             // Public function to set location's hash. Usefull because browser's security does not allow to get/set document.getElementById("my-iframe").contentWindow.location.hash
             var setHash = function(e) {
                 // e.data is the string sent by the origin with postMessage.
-                if(e.data.split('#')[0] == 'setHash') {
-                    window.location.setHash(e.data.split('#')[1]);
+                if(e.data.substr(0,1) == '#') {
+                    window.location.hash = e.data.substr(1);
                 }
             }
             // we have to listen for 'message'