I wrote the following function in javascript:
function maskString(input) {
return input.replace(/ss+/, );
}
Very simple.
In a second function I wrote:
function secondFunction(string1, string2) { //Attetion! See Update 2!
var string1masked = maskString(string1);
var string2masked = maskString(string2);
( ... )
}
The error message is:
TypeError: Result of expression 'input.replace' [undefined] is not a function.
Anybody an idea? Google wasn't really helpful :
UPDATE 1:
I'm using jQuery and string1 is from an textbox. I'm calling the second function like this:
var bool = secondFunction (textarea1.val(), textarea2.val()); //Attetion! See Update 2!
UPDATE 2:
I was wrong with the second function ... It's:
function secondFunction(string1, array1) {
var string1masked = maskString(string1);
var array1masked = maskString(array1);
( ... )
}
So my function doesn't work with the array. Unfortunately I have no idea how to change it :(