Hi Team,
I am facing some challenges in the loading time of the webpart(15 secs). I was pulling data from the list and binding it to the drop down control in ajax but it has some waiting time since async call is involved.
I need a better performance how this can be achieved. can anyone provide insights.
- function getPackingSites()
- {
- var packagingSiteUrl = siteAbsUrl + "/_api/web/lists/GetByTitle('"+packingSiteList+"')/Items";
- var packagingSiteOptions ="";
- $.ajax({
- url:packagingSiteUrl,
- method: "Get",
- async: false,
- headers: {
- "accept": "application/json;odata=verbose",
- },
- success: function (PackingSiteData) {
- if (PackingSiteData.d.results.length > 0) {
- for (var i = 0; i < PackingSiteData.d.results.length; i++) {
- packagingSiteOptions += "";
- }
- }
- },
- error: function (x, e) {
- alert(e.message.tostring());
- }
- });
- $("#PackingSiteDropdwn").html(packagingSiteOptions);
- var tempLink = '+siteAbsUrl+'/pages/Create.aspx?PackSiteID='+$("#PackingSiteDropdwn").val()+'&Source='+siteAbsUrl+'">Submit';
- $("#newformSubmitSpan").html(tempLink);
- }
- }
1 Reply
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.

Roshni GandhiPosted Mar 9, 2020, 6:26 AM