Clear a Page that is being loaded by using .load jQuery
-
Hi, I have code as below, which loads a partial view in which I have a Grid, but for some reason when one of the load doesn't happen because some failure or missing View etc, the previous partial view remaining unchanged, can somebody please help me how can I clear the previous page load when loading the current Page. Any help a code snippet, a link or a suggestion anything helps thanks a lot in advance my friends.
function GetLookupTableValue(e) { if ($("#drpLookup").data("kendoDropDownList").text() != 'Select') myHeader.innerText = "List of " + $("#drpLookup").data("kendoDropDownList").text(); else myHeader.innerText = ""; var noCodeFilter = containsAny($("#drpLookup").data("kendoDropDownList").text(), \['Address Type', 'Gender', 'NPI Status', 'Rendering Provider Status', 'Rendering Provider Classification'\]); if (noCodeFilter) { var url = '../Admin/GetLookupTableNoCode'; $("#divLookupTable").load(url, { LookupTableId: $("#drpLookup").data("kendoDropDownList").value(), \_\_RequestVerificationToken: $('input\[name=\_\_RequestVerificationToken\]').val() }); } else if ($("#drpLookup").data("kendoDropDownList").text() == 'Medi-Cal - Mode of Service - Service Function') { var url = '../Admin/GetMCMSSFCrosswalkList'; $("#divLookupTable").load(url, { LookupTableId: $("#drpLookup").data("kendoDropDownList").value(), \_\_RequestVerificationToken: $('input\[name=\_\_RequestVerificationToken\]').val() }); } else if ($("#drpLookup").data("kendoDropDownList").text() == 'Service Function Category') { var url = '../Admin/GetServiceFunctionCategoryLKPList'; $("#divLookupTable").load(url, { LookupTableId: $("#drpLookup").data("kendoDropDownList").value(), \_\_RequestVerificationToken: $('input\[name=\_\_RequestVerificationToken\]').val() }); } else { var url = '../Admin/GetLookupTableCode'; $("#divLookupTable").load(url, { LookupTableId: $("#drpLookup").data("kendoDropDownList").value(), \_\_RequestVerificationToken: $('input\[name=\_\_RequestVerificationToken\]').val() }); } }
Thanks, Abdul Aleem "There is already enough hatred in the world lets spread love, compassion and affection."
-
Hi, I have code as below, which loads a partial view in which I have a Grid, but for some reason when one of the load doesn't happen because some failure or missing View etc, the previous partial view remaining unchanged, can somebody please help me how can I clear the previous page load when loading the current Page. Any help a code snippet, a link or a suggestion anything helps thanks a lot in advance my friends.
function GetLookupTableValue(e) { if ($("#drpLookup").data("kendoDropDownList").text() != 'Select') myHeader.innerText = "List of " + $("#drpLookup").data("kendoDropDownList").text(); else myHeader.innerText = ""; var noCodeFilter = containsAny($("#drpLookup").data("kendoDropDownList").text(), \['Address Type', 'Gender', 'NPI Status', 'Rendering Provider Status', 'Rendering Provider Classification'\]); if (noCodeFilter) { var url = '../Admin/GetLookupTableNoCode'; $("#divLookupTable").load(url, { LookupTableId: $("#drpLookup").data("kendoDropDownList").value(), \_\_RequestVerificationToken: $('input\[name=\_\_RequestVerificationToken\]').val() }); } else if ($("#drpLookup").data("kendoDropDownList").text() == 'Medi-Cal - Mode of Service - Service Function') { var url = '../Admin/GetMCMSSFCrosswalkList'; $("#divLookupTable").load(url, { LookupTableId: $("#drpLookup").data("kendoDropDownList").value(), \_\_RequestVerificationToken: $('input\[name=\_\_RequestVerificationToken\]').val() }); } else if ($("#drpLookup").data("kendoDropDownList").text() == 'Service Function Category') { var url = '../Admin/GetServiceFunctionCategoryLKPList'; $("#divLookupTable").load(url, { LookupTableId: $("#drpLookup").data("kendoDropDownList").value(), \_\_RequestVerificationToken: $('input\[name=\_\_RequestVerificationToken\]').val() }); } else { var url = '../Admin/GetLookupTableCode'; $("#divLookupTable").load(url, { LookupTableId: $("#drpLookup").data("kendoDropDownList").value(), \_\_RequestVerificationToken: $('input\[name=\_\_RequestVerificationToken\]').val() }); } }
Thanks, Abdul Aleem "There is already enough hatred in the world lets spread love, compassion and affection."
load
function accepts another parameter which is a function (ajax callback) that takes in response, status and xhr. In case of any error, status will have the error code in it. You can evaluate that and do as needed. Your code can be refactored to avoid repeated blocks in if/else blocks."It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[^]
-
load
function accepts another parameter which is a function (ajax callback) that takes in response, status and xhr. In case of any error, status will have the error code in it. You can evaluate that and do as needed. Your code can be refactored to avoid repeated blocks in if/else blocks."It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[^]
Can you please give me a small sample of load response error status code and can you please give me small sample of how to refactor the repeated if else blocks. A sample or even a link helps please - thank you very much for your suggestion buddy. Thanks, Abdul Aleem "There is already enough hatred in the world lets spread love, compassion and affection."