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

New Post: global variables

$
0
0

I re-did that portion of the code, pushing into an array (arWritten) the items show from xData.responseXML.

global variables: arWritten (and others)

doStuff is invoked upon successful reading of email (each email represents one list entry).

Near beginning of doStuff a reference to arWritten shows empty. In the next line, we have this:
    if($.inArray(strCombo1, arWritten) > -1) {
        arCurrentDupes.push(strCombo1);
        //alert("just orphaned: " + strCombo1); //shows fine!
    }

So, although showing empty, when queried for existence of strCombo1, correctly responds to its existence (1 instance). arWritten gets populated by SPServices at end of the writeNew function. Beginning of writeNew shows the proper contents of the array, as does a display call right after insertion of its latest element.

Although arWritten is declared globally, with its contents it only shows within the function in which it is filled. Although the calling function (doStuff) cannot show those contents, we see that it programmatically exists.

All this is happening within IE7. I point this out, because an experiment several months ago showed me just how different instances of JavaScript processing can be among browsers.


Viewing all articles
Browse latest Browse all 6517

Trending Articles



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