Quantcast
Channel: jQuery Library for SharePoint Web Services
Viewing all articles
Browse latest Browse all 6517

New Post: Heavy load js - SP2010 - long time running script - freeze browser

$
0
0
Hello,
I have long time running js which freeze browser.
I trying to update all list items from 2 secondary lists (every item from list one could have multiple children items in two secondary lists joined together with custom id of an item). Using jquery and spservices.

Script should run on click and display progress bar. I tried many different ways (async: true,false; setTimout(), setInterval() ...) but I cant get to work any kind of progress bar and browser cant handle any user interaction (freeze) during the script. Have anyone any idea how I could improve the script? (I could post more parts but I try to keep it simple for read)
setInterval(updateUsers(),100)

function updateUsers() {
  jQuery().SPServices({
  operation: 'GetListItems',
  async: true,
  .....
  completefunc: function(xData, Status) {
  jQuery(xData.responseXML).SPFilterNode("z:row").each(function() {
  .....
    jQuery().SPServices({
      operation: 'GetListItems',
      ....
      completefunc: function(xData, Status) {
        jQuery(xData.responseXML).SPFilterNode("z:row").each(function() {
        ....
    });});});
    jQuery().SPServices({
      operation: 'GetListItems',
      ....
      completefunc: function(xData, Status) {
        jQuery(xData.responseXML).SPFilterNode("z:row").each(function() {
        ....
    });});});
    jQuery().SPServices({
      operation: "UpdateListItems",
      listName: 'Odboráři',
      ....
    });
    setTimeout(updateProggress(),0);
  });});});
}

function updateProggress() {
//some cool progressbar
}

Viewing all articles
Browse latest Browse all 6517

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>