Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum

Get help for TinyWebGallery, the best image gallery. The forum is also home for the Joomla JFUploader, TWG Flash Uploader and the Wordpress flash uploader.
It is currently 24. Oct 2017, 13:30

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: 20. Sep 2016, 10:42 
Offline

Joined: 18. Sep 2016, 12:11
Posts: 4
Hello,

I was reading another similar thread at:
http://www.tinywebgallery.com/forum/advanced-iframe-support-f21/iframe-auto-resize-height-not-working-t4130.html
but what suggested there still doesn't work.

Writing about this page:
http://e-promos.hu/mobil-kupon-ct/
I inserted an AIP shortcode into my webpage:
[advanced_iframe securitykey="83***c2" use_shortcode_attributes_only="true" src="http://externaldomain.com/p/7ngu9g" enable_external_height_workaround="true" scrolling="no" onload_resize="true"]

I inserted the following into external page's code:
<script>document.domain='e-promos.hu';</script>
<script>
var iframe_id = "iframe";
var updateIframeHeight = "true";
var iframe_content_id = "#iframe";
var hide_page_until_loaded_external = "true";
</script>
<script src="http://e-promos.hu/wp-content/plugins/advanced-iframe/js/ai_external.js"></script>


Previously my backend was available via https but I changed it to http because of your docs about problems using http and https together.
Testing it in Chrome javascript console it shows:
Uncaught SecurityError: Failed to set the 'domain' property on 'Document': 'e-promos.hu' is not a suffix of 'externaldomain.com'.
DOMException: Blocked a frame with origin "https://e-promos.hu" from accessing a cross-origin frame.(…)
Unknown RPC service: oauth2relayReady:868894154

so it still tries https, even after I both cleared all server side caches and browser cache.

Any idea is appreciated.
Thanks,
V.


Top
 Profile  
 
PostPosted: 20. Sep 2016, 11:11 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 10502
Hi,

http://www.tinywebgallery.com/forum/advanced-iframe-support-f21/iframe-auto-resize-height-not-working-t4130.html
does not work because it it not configured properly. See my last answer there!

About your shortcode:
onload_resize="true" only works for the same domain - remove this.

<script>document.domain='e-promos.hu';</script>
only works for sub domains!! This is why you get an error!

Make sure you regenerate ai_external.js by saving the administration again!
Because there the callback urls are saved! So most likely there is still the old https domain there.

Best, Michael


Top
 Profile  
 
PostPosted: 20. Sep 2016, 11:44 
Offline

Joined: 18. Sep 2016, 12:11
Posts: 4
Hi Michael,

it works, thank you!

I added
additional_height="3"
to my shortcode, which doesn't look working, but I suppose it is only a caching issue.
I also pressed "Update settings" on AIP's admin screen, after shortcode change, but it still doesn't look working...

BTW you mean every time I modify the shortcode, I have to regenerate ai_external.js by saving the administration again, and clean all server side cache manually?

Thanks,
V.


Top
 Profile  
 
PostPosted: 20. Sep 2016, 12:51 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 10502
if you use the external workaround you either have to define it before you include the ai_external.js like:

<script>
var updateIframeHeight = "true";
</script>
<script src="http://e-promos.hu/wp-content/plugins/advanced-iframe/js/ai_external.js"></script>

or if you have only one iframe you can set most of the settings directly in the administration and saving them does regenerate the ai_external.js.

and NO - if you change the shortcode the ai_external.js has nothing to do with it! The shortcode has only settings for the same domain or the parent page.
So your additional height needs to be set before the ai_external.js or you set it on the "external workaround" tab and save the settings!

All settings that are saved to the ai_external.js have this save icon in the administration.

Is this clear? The external workaround works completely with the ai_external.js. This can be configured directly in the administration or by settings the variables before including the ai_external.js. The shortcode only includes the iframe with all local settings and inserts the Javascript that is needed for communication.

Best, Michael


Top
 Profile  
 
PostPosted: 20. Sep 2016, 15:19 
Offline

Joined: 18. Sep 2016, 12:11
Posts: 4
I'm sorry it is not totally clear what I should have to do :(

I've already inserted code into external page:
<script>
var iframe_id = "iframect8";
var updateIframeHeight = "true";
var iframe_content_id = "#iframect8";
var hide_page_until_loaded_external = "true";
</script>
<script src="http://e-promos.hu/wp-content/plugins/advanced-iframe/js/ai_external.js"></script>

so the required
var updateIframeHeight = "true";
code is in there, before the ai_external.js.

Since I will have 1 iframe on 1 page but different iframes on different pages, possibly with different settings, I think I can't set it up in admin area, but only with shortcodes.

I use this shortcode on my page now:
[advanced_iframe securitykey="83***c2" use_shortcode_attributes_only="true" src="http://EXTERNALDOMAIN.com/p/7ngu9g" id="iframect8" name="iframect8" width="480" enable_external_height_workaround="true" additional_height="50" scrolling="no"]

I also tried to add:
store_height_in_cookie="false"
into the shortcode above, but even after clearing Chrome's cache and cookies it still is not working, no additional height added to the iframe...

Thanks,
V.


Top
 Profile  
 
PostPosted: 20. Sep 2016, 22:50 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 10502
Check my last post.

You have added the additional height in the shortcode! There it is only o.k. if you are on the same domain.

It has to be a settings before the ai_external.js.
var element_to_measure_offset=50;

But why do you need the 50 px? Ts the height measured wrong? Because if you need an additional offset for the iframe you should use css on the parent side to do this.

Best, Michael


Top
 Profile  
 
PostPosted: 20. Sep 2016, 23:20 
Offline

Joined: 18. Sep 2016, 12:11
Posts: 4
Unfortunatelly in your last but one post you referred to there was
var updateIframeHeight = "true";
instead of:
var element_to_measure_offset=50;
which (the first) had already been in my code and that's why I didn't understand you...

I used 50px first just surely see that it works, to see the difference. Finally I used 6px and this way the bottom part of iframe also looks OK.

Thank you, my issue is solved.
Best,
V.


Top
 Profile  
 
PostPosted: 21. Sep 2016, 09:16 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 10502
<script>
var updateIframeHeight = "true";
</script>
<script src="http://e-promos.hu/wp-content/plugins/advanced-iframe/js/ai_external.js"></script>

was only an example how you should include the code. Using the right parameters here was not what I wanted to show.

But if you have it working now it is great.

Best, Michael


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron
Powered by phpBB® Forum Software © phpBB Group

phpBB SEO