Skip to content

Commit 6e68bfd

Browse files
committed
Update JSFileAjaxCall.js
1 parent a39f9da commit 6e68bfd

1 file changed

Lines changed: 19 additions & 19 deletions

File tree

‎JSFileAjaxCall.js‎

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
$(document).ready(function () {
22
try {
3-
setvariables here;
4-
SOWDetails.CompileTemplates();
5-
SOWDetails.GetSOWInfo();
3+
//setvariables here;
4+
SOWDetails.CompileTemplates(); //compile the jquery templates before binding
5+
SOWDetails.GetSOWInfo(); //data call here in DOM ready event
66
}
77
catch (Err) {
88

99
}
1010
});
1111

1212
var GlobalVars = {
13-
list of global variables here;
13+
//list of global variables here;
1414
};
1515

1616
var SOWDetails = {
@@ -26,10 +26,10 @@ var SOWDetails = {
2626

2727
},
2828
MakeAjaxCall: function () {
29-
var sowId = $('#hdnSOWID').val();
30-
var year = GlobalVars.year;
29+
var sowId = $('#<id>').val();
30+
var year ="2014";
3131
$.ajax({
32-
url: "SOWDetails/" + sowId + "/" + year,
32+
url: "SOWDetails/" + sowId + "/" + year, //call WCF REST service here
3333
type: "GET",
3434
dataType: "json",
3535
contentType: "application/json; charset=utf-8",
@@ -48,18 +48,18 @@ var SOWDetails = {
4848
error: function (jqXHR, textStatus, errorThrown) {
4949
var responseText = jqXHR.responseText;
5050
if (typeof (responseText) != 'undefined' &&
51-
(responseText.toString().toLowerCase().indexOf("siteminder") >= 0
52-
|| responseText.toString().toLowerCase().indexOf("html") >= 0)) {
53-
SOWDetails.RedirectOnTimeout();
51+
(responseText.toString().toLowerCase().indexOf("<any text>") >= 0) {
52+
SOWDetails.RedirectOnTimeout(); //handle timeout if any here
5453
}
55-
else if (jqXHR == null || textStatus === 'timeout') {
54+
else if (jqXHR == null || textStatus === 'timeout') { //handle session expire here
5655
alert('Session expired or timed out: Restart Browser');
5756
SOWDetails.RedirectOnTimeout();
5857
return false;
5958
}
6059
else {
61-
alert("Request Error /SOWDetail/MakeAjaxCall/. \njqXHR: " + jqXHR + "\n textStatus: " + textStatus + "\n errorThrown: " + errorThrown);
62-
var params = "SOW ID: " + sowId + " Year: " + year;
60+
//handle request error here
61+
alert("Request Error /MakeAjaxCall/. \njqXHR: " + jqXHR + "\n textStatus: " + textStatus + "\n errorThrown: " + errorThrown);
62+
var params = "";
6363
SOWDetails.SendMailOnException(params);
6464
}
6565
}
@@ -157,10 +157,10 @@ var SOWDetails = {
157157
}
158158
},
159159
HandleRedirectionAndStyles: function () {
160-
if (GlobalVars.Page == 'MPF') {
161-
$('#divAssignedProjects').css('height', '350px');
162-
$('#acrMPFLink').css('cursor', 'auto').css('textDecoration', 'none');
163-
document.getElementById('acrMPFLink').onclick = function () {
160+
if (GlobalVars.Page == '<anypagename>') {
161+
$('#<id>').css('height', '350px');
162+
$('#<id>').css('cursor', 'auto').css('textDecoration', 'none');
163+
document.getElementById('<id>').onclick = function () {
164164
return false;
165165
}
166166
}
@@ -206,10 +206,10 @@ var SOWDetails = {
206206
});
207207
},
208208
hideProgress: function () {
209-
$("#FPCDetailsLoading").css("display", "none");
209+
$("#<Loading>").css("display", "none");
210210
},
211211
showProgress: function () {
212-
$("#FPCDetailsLoading").css("display", "block");
212+
$("#<Loading>").css("display", "block");
213213
},
214214
ClearSOWTables: function (id, applyTrigger) {
215215
$('#' + id + ' tr').remove();

0 commit comments

Comments
 (0)