var _MULE_INCLUDE = {
 
  script: function(libraryName) {
    document.write('<script type="text/javascript" src="'+libraryName+'"></script>');
  },
  load: function() {
    var scriptTags = document.getElementsByTagName("script");
    for(var i=0;i<scriptTags.length;i++) {
      if(scriptTags[i].src && scriptTags[i].src.match(/mule\.js$/)) {
        var path = scriptTags[i].src.replace(/mule\.js$/,'');
        this.script(path + 'dojo/dojo.js');
        this.script(path + '_mule.js');
        break;
      }
    }
  }
}
 
_MULE_INCLUDE.load();

Using javascript to perform regex on a payload (thanks to Mark Lowe)

var find = '"$"';
var replace = '"DOLLAR"';
 
message.setPayload(  payload.replace(new RegExp(find.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'), 'g'), replace) );
result = message;

Misc

 
mule_and_javascript.txt · Last modified: 2014/09/01 10:00 by root
 
RSS - 200 © CrosswireDigitialMedia Ltd