Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum
https://www.tinywebgallery.com/forum/

Bug in ai.js
https://www.tinywebgallery.com/forum/viewtopic.php?f=21&t=4512
Page 1 of 1

Author:  klhurley [ 10. Jan 2018, 09:14 ]
Post subject:  Bug in ai.js

This:

function aiProcessMessage(event) {
var jsObject = JSON.parse(event.data);

is giving an error because event.data is already a JSON object and not a JSON string.

So, this fixes the error

function aiProcessMessage(event) {
var jsObject = event.data;

Author:  TinyWebGallery [ 10. Jan 2018, 16:42 ]
Post subject:  Re: Bug in ai.js

But who is sending this? My implementation ai_external.js does send a json string. So this does need the json.parse.

Where does this object come from? Is there a different message sent from the iframe?
Can you enable post message debug and check the output in the js console?

Best Michael

Author:  TinyWebGallery [ 10. Jan 2018, 18:01 ]
Post subject:  Re: Bug in ai.js

see: http://www.tinywebgallery.com/blog/advanced-iframe/advanced-iframe-pro-demo/external-workaround-with-post-message

There you can see in the Javascript console that this is fine.

So the question is where does this json object come from...

Best, Michael

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/