I see a bug (a missing closing quote) in that code so it should be:
Code:
$(document).ready(function() {
if($('p#tokenmessage').length > 0 && $('#tokenform').length == 0) {
var stringIndex = $('p#tokenmessage').text().indexOf('Diese Umfrage ist beendet und steht nicht mehr zur Verfügung');
if(stringIndex >= 0) {
$('p#tokenmessage').html('This survey is CLOSED!<br /><br />Go away!');
}
}
});
However, if using Spanish, you will need to replace the German string with whatever you see in Spanish. Probably this:
Code:
$(document).ready(function() {
if($('p#tokenmessage').length > 0 && $('#tokenform').length == 0) {
var stringIndex = $('p#tokenmessage').text().indexOf('Esta encuesta ya no está disponible');
if(stringIndex >= 0) {
$('p#tokenmessage').html('This survey is CLOSED!<br /><br />Go away!');
}
}
});
Having said that, if you want to redirect when the survey is closed instead of showing a custom message, try something like this (for Spanish):
Code:
$(document).ready(function() {
if($('p#tokenmessage').length > 0 && $('#tokenform').length == 0) {
var stringIndex = $('p#tokenmessage').text().indexOf('Esta encuesta ya no está disponible');
if(stringIndex >= 0) {
window.location = "https://google.com";
$('p#tokenmessage').html('This survey is CLOSED!<br /><br />You are being redirected to our website.');
}
}
});