I have written a function which its input should have line-feeds in it:
function goh(textt) {
textt = textt.split('\n');
for(i=0; i<textt.length; i++) {
textt[i] = i+'='+textt[i]
}
return textt.join('\n');
}
which for example I want to call it in this way:
goh("http://www.youtube.com/watch?v=
http://www.youtube.com/watch?v=
http://www.youtube.com/watch?v=
http://www.youtube.com/watch?v=
http://www.youtube.com/watch?v=
http://www.youtube.com/watch?v=
http://www.youtube.com/watch?v=");
but it gives me this error in the firefox's console. (BTW I have read all the questions asked about this before ...)
SyntaxError: unterminated string literal
How can I fix this problem?
EDIT:
Please everyone listen. I knew what are you talking here. in that case I would add the \n
myself xD. I want the script does this for me
I want to pass the RAW Input.