How do I use holdReady
along with doc ready? I need to make sure that holdReady
gets fired before doc.ready, I am trying below but no luck as loadTab3()
is still getting fired before storeContentList
?
$.holdReady(true);
tab3Data = storeContentList('getArticleTypelistById', 'atid', '88', '5', '123');
$.holdReady(false);
$(document).ready(function () {
// tab3Data gets used in loadTab3 function below.
loadTab3();
});
function storeContentList(webServiceName, parameterName, parameterValue, noOfItems, IDstoExclude) {
var inputParameters = webServiceName.toLowerCase() + ':' + parameterName.toLowerCase() + ':' + parameterValue + ':noofitems:' + noOfItems + ':excludeids:' + IDstoExclude;
var clientcode = getCryptoToken(inputParameters);
eval("data={" + parameterName.toLowerCase() + ":" + parameterValue + ", noofitems:" + noOfItems + ", excludeids:'" + IDstoExclude + "',clientcode:'" + clientcode + "' }");
$.ajax({
url: 'https://abc/Service.svc/' + webServiceName,
dataType: 'jsonp',
async: false,
data: data,
success: function (data) {
//tab3Data = JSON.stringify(data);
tab3Data = data;
console.log('tab3Data in storeContentList function:' + tab3Data);
return data;
},
error: function (data) {
console.log('err occured');
}
});
}