zenario.refreshPluginSlot()
zenario.refreshPluginSlot(slotName, instanceId, additionalRequests, recordInURL, scrollToTopOfSlot, fadeOutAndIn, useCache, post)
You can call this function to refresh/reload a plugin by AJAX, with the specified GET requests.
You can call this function to refresh/reload a plugin by AJAX, with the specified GET requests.
slotName
The name of the slot to refresh.
If the slot contains a nest, then all of the plugins in the nest will be refreshed, not just one.
instanceId
The instance id of the plugin.
You can set this to "lookup" if you want it to be looked up automatically.
additionalRequests
Any GET requests you wish to add to the AJAX request.
You can provide a URL request string, or an object of key-value pairs.
recordInURL
If this is set to true, any GET requests you provide will be added to the URL of the current page.
This will only work if a visitor's browser supports HTML5, however a "hash-bang" system is used as a fallback for browsers that don't support HTML5.
scrollToTopOfSlot
This will cause the user's browser to scroll up to the top of the slot that is being reloaded.
If not defined, the default value is true.
fadeOutAndIn
This will cause the slot and its contents to fade out slightly whilst it is reloading.
If you wish to display an AJAX loader or some other sort of loading symbol, you can achieve this by styling the background behind the slot, as the background will be visible whilst the slot is faded out.
If not defined, the default value is true.
useCache
If this is set to true, the CMS will store AJAX requests in the browser's session cache and only actually perform an AJAX request if the request is not already in the cache.
This behaviour can be somewhat confusing when developing a site, as you can make changes to a plugin but then not see the changes if a request is cached, so it is disabled by default.