Saturday, July 25, 2015

script to force spservices to work.

<script src="****/jquery-2.1.3.min%20(1).js" type="text/javascript"></script>
<script src="******/jquery.SPServices-2014.02.min.js" type="text/javascript"></script>

<script language="javascript" type="text/javascript">
function insureSPServices(callbackFunction) {
    if($().SPServices == null) {
        // If SPServices has not been loaded, this will return as a null value and let us know we need to load the library. The jQuery
        // getScript method runs asynchronously, so we use the callback function for initial calls to the service
        jQuery.getScript("https://pslightwave.sharepoint.com/sites/Operations/WorkOrders/SiteAssets/jquery.SPServices-2014.02.min.js", callbackFunction);
    } else {
        // SPServices is already loaded, so execute our callback function which contains the rest of the page initialization.
        callbackFunction.call(null, "Already Loaded");
    }
}
 


$(document).ready(function() {
  alert("loading");
insureSPServices(InitializePage);
//your code here........//

});


</script>

No comments:

Post a Comment