0

I need to reload the 2 javascripts listed below but not sure how to reference then in my function. I read several other forums that suggested to try using the deferred function in Jquery. So I tried it but no luck. Any ideas?

Javascripts:

<SCRIPT LANGUAGE="JavaScript" SRC="Scripts/Inline/InlineEditingForSP2007_23.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="Scripts/Inline/spjs-utility.js"></SCRIPT>

This is the function I tried but is not working.

  function reload() {
    $.ajax({
      async: false,
      cache: false,
      url: "http://ensemble-mtl.ent.cginet/sites/SERVIPCManagement/imc/Shared%20Documents/Whiteboard/Whiteboard-Inline.aspx",
      complete: function(xData, Status) {
        var DVWPMarkup = $(xData.responseText).find("#reload_me").html();
        $("#reload_me").html(DVWPMarkup);
        inline();
      }
    });
  }

  function inline() {
    $.when(
      $.getScript("Scripts/Inline/InlineEditingForSP2007_23.js"),
      $.getScript("Scripts/Inline/spjs-utility.js"),
    ).then(function() {
      var argObj = {
        dateFormat: "d/m/yy",
        decimalSeparator: ".",
        boolYesNoText: "Yes|No",
        labelArr: ["Save", "Cancel", "Clear"],
        arrToEdit: [],
        pinTableHeader: true,
        hideIdColumn: true
      };
      initCustomEditFunction(argObj);
    });

  }

  $(document).ready(function() {
    reload();
    var auto_refresh = setInterval(function() {
      reload();
    }, 60000);
  });
empiric
  • 7,825
  • 7
  • 37
  • 48
Daniel Ellison
  • 1,339
  • 4
  • 27
  • 49
  • 1
    Yet another one using synchronous ajax... I don't have a clue where this dumb fashion comes from, but it's the hit of the year. This being said, just add a random number at the end of your script url to force the browser to reload it. `` . Change the number with another script, and it will reload. – Jeremy Thille Apr 27 '15 at 10:41
  • Thanks for the reply, I tried what you suggested but didn't do anything for me. I would need to reference these scripts within my reload function. Every time the reload starts it breaks my java scripts. Any idea? – Daniel Ellison Apr 27 '15 at 13:10

0 Answers0