I am trying a implement a simple if statement based on a cookie setting. The function is as follows:
function setHomePage() {
if ($.cookie('settingOne') == 'jjj')
{
$('.secO').css('display', 'block');
$('.secT').css('display', 'none');
}
else if($.cookie('settingOne') == 'ppp')
{
$('.secO').css('display', 'none');
$('.secT').css('display', 'block');
}
}
The function is called on load but not sure if the if statement syntax is correct.
If I alert the cookie setting I can confirm that they are set. Has anyone done something similar and confirm if my syntax is correct?
Aucun commentaire:
Enregistrer un commentaire