You need to be logged in to post in the forum - Log In
An active JCE Pro Subscription is required to post in the forum - Buy a Subscription
Hi,
I am using the popup for displaying a live-cam / weather cam.
Unfortunately somehow older images (jpgs) are loaded - not the latest images. Not good for a "live" cam.
Might be loaded from cache.
Can I adapt the code to get always the latest jpg into the popup???
thanks
I am using the popup for displaying a live-cam / weather cam.
Unfortunately somehow older images (jpgs) are loaded - not the latest images. Not good for a "live" cam.
Might be loaded from cache.
Can I adapt the code to get always the latest jpg into the popup???
<a class="jcepopup noicon" style="color: #338c14;" href="https://d38553.ispservices.at/panoramabild_big.jpg" target="_blank" rel="noopener" data-mediabox="1" data-mediabox-width="1200" data-mediabox-height="800" data-mediabox-title="Live-Cam Golfpark">WETTERCAM</a>
thanks
Try this script instead:
jQuery(document).ready(function($) {
$('.jcepopup').attr('href', function(i, val) {
if (/\.(jpeg|jpg|png)$/.test(val)) {
return val += '?' + new Date().getTime();
}
});
});
Just because you're not paranoid doesn't mean everybody isn't out to get you.
If you can add some javascript to your site, then add this:
jQuery(document).ready(function($) {
WfMediabox.Plugin.add('image', function () {
this.type = "image";
// create image html (leave src blank)
this.html = function (data) {
// add time to the url to prevent caching...
data.src += '?' + new Date().getTime();
var $img = $('<img src="' + data.src + '" class="wf-mediabox-img" alt="' + decodeURIComponent(data.alt || data.title || "") + '" tabindex="0" />');
if (data.params) {
$.each(data.params, function (name, value) {
$img.attr(name, value);
});
}
return $img;
};
this.is = function (data) {
var src = data.src;
// remove query to test extension
src = src.split('?')[0];
return /image\/?/.test(data.type) || /\.(jpg|jpeg|png|gif|bmp|tif|webp)$/i.test(src);
};
});
});
Just because you're not paranoid doesn't mean everybody isn't out to get you.
I have put the script tinto the js file of the template as the template support told me.
The script seems to work, loads latest jpg - but it affects other modules.
1. the slideshow module does not show any images just white space.
2. the pop is no poup anymore, just a jpg in a blank new window.
I could live with #2, but #1 is bad.
The script seems to work, loads latest jpg - but it affects other modules.
1. the slideshow module does not show any images just white space.
2. the pop is no poup anymore, just a jpg in a blank new window.
I could live with #2, but #1 is bad.
Try this script instead:
jQuery(document).ready(function($) {
$('.jcepopup').attr('href', function(i, val) {
if (/\.(jpeg|jpg|png)$/.test(val)) {
return val += '?' + new Date().getTime();
}
});
});
Just because you're not paranoid doesn't mean everybody isn't out to get you.
- Page :
- 1
There are no replies made for this post yet.
Be one of the first to reply to this post!
Be one of the first to reply to this post!