If I copy and paste each part of this function everything works. However when I try to use the function on its own I get:
VM7192:4 Uncaught TypeError: Cannot read property 'match' of undefined
My function is:
var read_f = function() {
var restext = $.get('file.txt');
var text = restext.responseText;
text = text.match(/[a-zA-Z0-9]/g);
text = text.join('').split(/Q0/);
return text;
};
What's happening ?