How do I link to external js in this case?

How do I link to external js in this case?

 Hi, if anyone can help me out with this, i would be really thankful. Basically, try to call external js that has EncodeSearchTerm function, because the external JS's EncodeSearchTerm function will be changed constantly by someone, so instead of going to change my js EncodeSearchTerm again, is there way to seamless integrate based on external js file? 

Let say, my JS file is myjs.js, and the external js is othersource.js

Following are the myjs.js as an example:

$("form.rm-search-form").submit(function(event) {
  var location = EncodeSearchTerm($('#FindLocations').val());
  var jobTitle = EncodeSearchTerm($('#FindJobTitles').val());
  var url = ' http://mywebsite.com/Jobs/q-' + jobTitle + '-l-' + location;
  window.open(url, '_blank');
  event.preventDefault();
  event.stopPropagation();
  });


  var encodingDic = {
  "/": "-or-",
  "\\": "-or-",
  ".": "-dot-",
  "&": "-and-",
  "+": "-plus-",
  "%": "-perc-",
  "?": "-ques-",
  "#": "-hash-",
  "$": "-dlr-",
  "*": "-star-",
  "!": "-mrk-",
  "\"": "-quat-",
  "'": "-apos-",
  "<": "-lt-",
  ">": "-gt-",
  "|": "-pipe-",
  ":": "-cln-"
  };

  this.EncodeSearchTerm = function(term) {
  var encodedSearchTerm = '';
  for (var i = 0, len = term.length; i < len; i++) {
  if (typeof encodingDic[term[i]] != 'undefined') {
  encodedSearchTerm += encodingDic[term[i]];
  } else {
  encodedSearchTerm += encodeURIComponent(term[i]);
  }
  }
  return encodedSearchTerm;
  }