The resize is only done when an onload event does happen. And this is then the inner page gets a new url. When an AJAX call happens this does not happen right now.
Can you point me to the scripts that do this? I can then add this to the next version of the advanced iframe.
Thanks for your quick reply. Don’t see many plugin authors that resolve all their support issues like you do. As for the scripts, i’m afraid i spoke out of turn. I’m sure i came about some solutions when browsing the web (using onclick? pageloaded? events), but i’m unable to find them again. I don’t have enough knowledge to filter the working solutions from the unsolved ones.
Anyway, I’m sure someone will find a workaround one of these days. For now, you’ve answered my question so i’ll mark this as resolved.
Can you modify the page in the iframe? Because then you can simply call the javascript function of the advanced iframe when the ajax call has finished.
I’m thinking about something like catching all onclick events. But then there would have to be a timeout as well because Ajax call take some time.
But the onclick solution would catch stuff like expanding divs…
hi, I just did a few test yesterday an it is possible to catch the AJAX events in the iframe. I already have a version where the resize works nice.
do you want to test it?
I’d like to test it on a site I’m interfacing with.
Cool,
I have upload it to
http://www.tinywebgallery.com/dl.php?file=advanced-iframe
This is then version 3.1 already.
Look for the setting “Resize on AJAX events”. There you have to enter a number. This is the timeout the resize is called. 0 should be fine for most cases because I catch the call after the callback is executed which normally does the replace.
I added this timeout for e.g. pages which do some scroll down when loaded.
I will also be testing it. Can hardly believe how quick you came up with a solution. If it works, your plugin will finaly bridge the gap between buddypress and wordpress.
Be ware that both page must be on the SAME domain.
If it does not work please tell me which Javascript framework is used on the page you want to include. Because maybe they overwrite this as well.
Best,
Michael
Right now it’s not working. I’m testing on a single domain using the follwoing shortcode:
[advanced_iframe securitykey=”key” src=”source” resize_on_ajax=”tried 5 to 5000″] with the option ‘Resize iframe to content height’ turned on.
jQuery framework
o.k. – I’ll setup an example page with jquery only and test there. I only took a quick look in the jquery sources and they seem to overwrite my stuff. So I might have to hook into jquery somewhere…
My test page was using the XMLHttpRequest object directly…
Btw. it is best to use only [advanced_iframe securitykey=”key”] and set the defaults in the administration.
Ok, I’ll wait for your update then. Thanks for your quick support. I’ll limit the use of shortcode parameters in the future.
Thanks. I tried it out on my end and it didn’t work. It maybe worth noting the site I’m using in the Iframe is on another domain, but I am using the XSS workaround.
Have you extracted my code that intercepts the AJAX call and added it to the remote site?
Because this has to be done here.
But as mentioned before. My current solution does not work with jquery sites because jQuery does overwrite theis calls as well.
I’ll try to find a jquery (jquery on the page you want to include) compatible solution as well.