Reputation: 57
I have this code:
var termsAccept = '';
<?php if($wpmailup['termsConfirm'] == 'yes'): ?>
if(jQ('#terms-confirm').is(':checked') == false)
{
jQ('#show-response').html('per favore, conferma di aver letto l'informativa');
viewInfoIcon('info');
return false;
}
else
{
termsAccept = jQ('#terms-confirm').val();
}
<?php else: ?>
termsAccept = 'yes';
<?php endif; ?>
Actually my error is a syntax error in this line: .html('per favore, conferma di aver letto l'informativa');
My question is: How can I solve this syntax error?
Upvotes: 1
Views: 74
Reputation: 6752
You could use double quotes so you won't escape with single quotes:
jQ('#show-response').html("per favore, conferma di aver letto l'informativa");
Although I would recommend the solution of Adam
Upvotes: 1
Reputation: 1985
jQ('#show-response').html('per favore, conferma di aver letto l\'informativa');
You need to escape the '
Upvotes: 1