-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnotify-survey.js
More file actions
51 lines (46 loc) · 1.71 KB
/
notify-survey.js
File metadata and controls
51 lines (46 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
$(document).ready(function(){
if (JSON.parse(localStorage.snsUsrDetails1).usrName !== "undefined" ) {
$('#usrDetails').hide();
$('#wlMsg').html('Welcome , ' + (JSON.parse(localStorage.snsUsrDetails1).usrName));
};
$(".fixed").hide();
if(!JSON.parse(localStorage.snsUsrDetails1).surveyTaken){
$(".fixed")
.fadeIn('slow')
.animate({'bottom': '+=130px'},'slow');
}
$(".cls").click(function(e){
$(".fixed").fadeOut('slow');
});
});
document.getElementById('YBtn').addEventListener('click', function() {
//alert('Great! we are happy that you liked this page');
var jqxhr = $.ajax( "http://localhost:8080/api/user/120" )
.done(function() {
alert( "success" );
})
.fail(function() {
//alert( "error" );
$('#douLike').hide();
$('#thxSurvey').show();
var snsUsrDetails1 = JSON.parse(localStorage.snsUsrDetails1);
snsUsrDetails1.surveyTaken = true;
localStorage.setItem("snsUsrDetails1",JSON.stringify(snsUsrDetails1));
});
});
var snsUsrDetails = {};
$('#btn_Submit').click(function(){
snsUsrDetails.usrName = $('#usrName').val();
snsUsrDetails.usrPwd = $('#usrPwd').val();
snsUsrDetails.usrEmail = $('#usrEmail').val();
if(typeof(Storage) !== "undefined") {
localStorage.setItem("snsUsrDetails1", JSON.stringify(snsUsrDetails));
/* localStorage.setItem("sns-usrPwd", usrPwd);
localStorage.setItem("sns-usrEmail", usrEmail);*/
console.log('localStorage Enabled');
console.log('localStorage - Saved Object' + ':' + JSON.parse(localStorage.snsUsrDetails1).usrName + ' ' + JSON.parse(localStorage.snsUsrDetails1).usrEmail);
} else {
console.log('No Storage support provided');
}
$('#usrDetails').hide();
})