Ajax Page load
-
Hello,
i tryed many different sliders and i pretty like these on.
But i have ajax-page-loading on my website. But the slider doesnt work if this is enabled. But i cant disable ajax-page-loading. How can i get it work? Can i trigger an init event?Thank you!
-
Hi @crazypsycho
Unfortunately AJAX can’t call complex codes (it was made to load simple ones) and the events that run during a normal page load doesn’t happen, so we don’t support the AJAX loading. (You can learn more about this here: https://smartslider3.helpscoutdocs.com/article/264-ajax-incalling-of-the-slider-dynamic-themes-popup-windows )
I suggest contacting your theme developers to learn how to disable the AJAX loading at the theme.I am the theme developer ?? But ajax-loading is absolutly standard on our websites. So disabling is no option.
Is this planed for future releases?Hi @crazypsycho
Unfortunately, no (and it’s not really up to us). As I said, when you load something with AJAX no page loading events are running, and these are essential for such complex JavaScript codes that our slider needs.
If AJAX would even improve that much that it could run native page loading events, then sure, we’d make sure that it can be used to load the slider, but until then, we can’t really do anything with AJAX but to suggest not using it, at leas on the pages where the slider is.Actually the only possibility I can think of that might work if you would publish the sliders by exporting them as HTML: https://smartslider3.helpscoutdocs.com/article/408-slider-options#exporthtml and then load the slider via iframe on your pages. This way the page loading events would run on the “other” page, so it might work. But this solution is rather complex.
Why you dont put the events to a function and call this function in the event?
So i can call the function, after page-loading is complete.But the idea with iframe is not so bad. I can create a template with only the slider and load this in an iframe. It is not really smart, but could work as a workaround.
- This reply was modified 7 years, 4 months ago by crazypsycho.
Hi @crazypsycho
Could you please send me your theme/plugin which makes the AJAX call in a zip format to [email protected]? I had a word with our senior developer and he thinks he might be able to figure out some in-between solution.
Hi,
this sounds good. And yes of course can i show you the plugin.
I use this plugin (its my own) for ajax-page-load:
https://github.com/crazypsycho/WordPress-PageSwapper
Here as zip:
https://github.com/crazypsycho/WordPress-PageSwapper/archive/master.zipThis javascript did the ajax:
https://github.com/crazypsycho/page-swapper/blob/master/page-swapper.jsHi @crazypsycho,
I tried to make your plugin work, but I’m stuck. I have several pages on the site and Twenty seventeen theme used. There is only your plugin installed on the site. When I switch page with the menu, something happen as the whole page hides, but when it should display the new page it displays “prev next” and a huge empty page with horizontal and vertical scrollbar. What do I miss?
Hello,
with default settings the plugin should swap and replace the hole <body>.
But as i see, with body it dont work anymore. I will fix this soon. Sorry for this bug.
For testing, you don′t need this fix.
You can go in wp-admin to PageSwapper. There you can set up a selector for content-wrapper. In Twenty seventeen it should be “.wrap”Thank you in advance for checking my feature request! It would be very nice if it will work with ajax.
@crazypsycho
I created a test package for you: https://www.dropbox.com/s/blg5ybwic65ohd6/nextend-smart-slider3-wordpress.zip?dl=0What it does?
When Smart Slider sees your signature, it will force itself to render sliders as an iframe. Iframe context makes sure that every asset file loads fine.This is the signature what matches:
if (isset($_GET[‘pswLoad’]) && $_GET[‘pswLoad’] == 1) {
…
}I do not feel this method secure, so I suggest you that on the page load when you match “pswLoad” inside your application to render the ajax version do add your custom action and then I could subscribe to that.
For exaple: do_action(‘pswload_ajax_render_page’);Then I would replace my check in the $_GET array to add_action(‘pswload_ajax_render_page’, ….);
Hello,
very thanks for that. But i have not enough time to test it today.
I will test it tomorow and add the pswLoad-action to my plugin.Okay, no problem. Just take your time for the testing. ??
Hello,
sorry for the late answer.
I have testet with your Zip. First there are two fatal errors, cause loadResources() must be public:
Fatal error: Access level to N2SSPluginItemFactoryCaption::loadResources() must be public (as in class N2SSPluginItemFactoryAbstract) in \wp-content\plugins\nextend-smart-slider3-pro\library\smartslider\plugins\item\caption\caption.php on line 157
Fatal error: Access level to N2SSPluginItemFactoryTransition::loadResources() must be public (as in class N2SSPluginItemFactoryAbstract) in \wp-content\plugins\nextend-smart-slider3-pro\library\smartslider\plugins\item\transition\transition.php on line 114I have make it public, to get it work.
The iframe-version works and load on ajax-load very well. It look like good work. Thanks for that.
I would test some responsive cases, but i can′t change the slider-settings anymore, cause i get an javascript-error in wp-admin.
TypeError: N2Classes.PostBgAnimationManager is not a constructorFor the pswLoad-Action i have to check some things. PageSwapper don′t render different on ajax-load. It loads the normal page. Only different is the Get-Parameter.
Hi @crazypsycho,
could you contact me directly on my email address? [email protected]
- The topic ‘Ajax Page load’ is closed to new replies.