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

Page is loading twice (when loading ai_external.js)
https://www.tinywebgallery.com/forum/viewtopic.php?f=21&t=5752
Page 1 of 4

Author:  Asle [ 8. Feb 2019, 20:59 ]
Post subject:  Page is loading twice (when loading ai_external.js)

My page loads all the html first, then it clears the page and reloads again. Do you know why? When I disable the ai_external.js in the iFrame page it does not reload so it must be something in the settings?

Page: https://biofokus.no/narin2/

Code on iframe page:

Code:
<script>
var iframe_id = "narinbio";
var element_to_measure_offset = 30;
var updateIframeHeight = "true";
var resize_on_element_resize = "#frame-content"
var enable_responsive_iframe = "true"
var hide_page_until_loaded_external = "true";
var iframe_content_id = "frame-content";
var iframe_content_styles = "overflow:hidden";
</script>   
<script src="https://biofokus.no/wp-content/plugins/advanced-iframe/js/ai_external.js?vs=38"></script>


My config on parent page:

Code:
[advanced_iframe use_shortcode_attributes_only="true" src="https://narin.biofokus.no/indexbio_sa.lasso" id="narinbio" enable_responsive_iframe="true" enable_external_height_workaround="true" width="100%" height="800" url_forward_parameter="ALL" add_iframe_url_as_param="remote" scrolling="no"]

Author:  TinyWebGallery [ 13. Feb 2019, 21:16 ]
Post subject:  Re: Page is loading twice (when loading ai_external.js)

it is not loaded twice. I seems it is only hidden for a few moments.

can you add
hide_page_until_loaded_external="true"
to the shortcode. Because then the page is hidden until loaded.

Best, Michael

Author:  Asle [ 13. Feb 2019, 23:40 ]
Post subject:  Re: Page is loading twice (when loading ai_external.js)

Great, that shortcode hides the page before it is loaded.

But my biggest problem is on mobile. The page takes ages to load. In Chrome it sometimes does not load and in Firefox very very slow. When I remove the link to ai_external.js in the iframe, the page loads fast but of course does not fit in height since there is not ai_external.js. Do you have any idea why the page is so slow on mobile? I know it is a complicated page but now it is useless on mobile view.

Author:  TinyWebGallery [ 14. Feb 2019, 00:05 ]
Post subject:  Re: Page is loading twice (when loading ai_external.js)

I have maybe a idea. Because to measure your page I need to wrap your whole content into another wrapper.

Are you able to modify the page in the iframe? Can you add one div around everything?
Means you have a
<div id="iframe-content">...</div>
<div id="colorbox">..</div>
<div id="lightbox">...</div>

can you make this
<div id="wrapper">
<div id="iframe-content">...</div>
<div id="colorbox">..</div>
<div id="lightbox">...</div>
</div>

because maybe modifying the dom is really expensive especially on mobile....

Best, Michael

Author:  Asle [ 18. Feb 2019, 17:27 ]
Post subject:  Re: Page is loading twice (when loading ai_external.js)

Thanks I tried this but still the page will not load in Chrome on Android. Firefox is no problem. I will try to reset Chrome on my mobile. But it seems the page loads and then only displays a blank page.

Author:  TinyWebGallery [ 20. Feb 2019, 23:42 ]
Post subject:  Re: Page is loading twice (when loading ai_external.js)

https://biofokus.no/narin2/ gives a 404 only. Is the page gone?

Best, Michael

Author:  Asle [ 21. Feb 2019, 10:27 ]
Post subject:  Re: Page is loading twice (when loading ai_external.js)

Sorry Michael, the page is published here:

https://biofokus.no/narin/

Author:  TinyWebGallery [ 21. Feb 2019, 11:32 ]
Post subject:  Re: Page is loading twice (when loading ai_external.js)

you still have not changed the structure ob the webpage. the ai-wrapper is still rendered.
See my last post about the struture.

Best, Michael

Author:  Asle [ 21. Feb 2019, 12:18 ]
Post subject:  Re: Page is loading twice (when loading ai_external.js)

Hi,
I did try to add an outer DIV to the content like you suggested but took it away because then Safari and Firefox were loading slow on IOS.

I have added it again now. You can test on Chrome on Android. It just shows blank iframe content.

https://biofokus.no/narin/

Author:  TinyWebGallery [ 21. Feb 2019, 14:02 ]
Post subject:  Re: Page is loading twice (when loading ai_external.js)

i think there is a different problem.

e.g. the lightbox does not exist. but it rendering a div at the bottom. can you put the wrapper also around the scripts at the bottom!

Best, Michael

Author:  Asle [ 22. Feb 2019, 13:26 ]
Post subject:  Re: Page is loading twice (when loading ai_external.js)

I tried to include all bottom JS inside the wrapper but this had no effect. The page on Chrome on Android takes ages to load. It eventually is loaded but can take one minute. No problem as I wrote on Firefox or IOS Safari.

Author:  TinyWebGallery [ 23. Feb 2019, 17:16 ]
Post subject:  Re: Page is loading twice (when loading ai_external.js)

My wrapper div is still rendered. Seems the Javascript is ignoring your wrapper and adds this to the outermost div. And my script runs after than and it wrapping again.
I think we should try to disable the creation of my wrapper.

Can you point you do a few places where you have to change code?

Best, Michael

Author:  Asle [ 23. Feb 2019, 17:32 ]
Post subject:  Re: Page is loading twice (when loading ai_external.js)

I removed the #wrapper div now. What more should I try?

Author:  TinyWebGallery [ 24. Feb 2019, 00:27 ]
Post subject:  Re: Page is loading twice (when loading ai_external.js)

I would have to tell you a few modifications in the ai_external.js. I would tell you how to deactivate the creation of my additional wrapper.
Is this o.k.?

Best, Michael

Author:  TinyWebGallery [ 24. Feb 2019, 01:27 ]
Post subject:  Re: Page is loading twice (when loading ai_external.js)

I will add a new option to skip the wrapper. Can you send you a new version?
I need a e-mail from you where you can get zip files (e.g. google does not work!)

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