PDA

View Full Version : Whats wrong with this jquery?



stefpretty
01 Nov 2009, 11:10 AM
I need to use the jquery cookie plug in to store a cookie so when they next visit the dialog doesnt appear.

It isnt working though and just keeps coming up!

HELP! :)


<script type="text/javascript">



$(function() {
$("#dialog").dialog({
bgiframe: true,
modal: true,
resizable: false,
autoOpen: true,
width:200,
buttons: {
Ok: function() {
$(this).dialog('close');
$.cookie('doneWin', 'closed' { expires: 2 });
}
}
});
});


</script>

<script type="text/javascript">
var doneWin = $.cookie('doneWin');

if (doneWin == 'closed') {
$("#dialog").dialog('close');

};
});
</script>

Regards,
Stefan

stefpretty
01 Nov 2009, 01:25 PM
Pleasse anyone? running on a deadline! :)