The console shows the error 'Uncaught SyntaxError: Unexpected token ILLEGAL' when string values with return characters -as in the example below- are passed to the function in the simplified code below. When a string value without return characters (like 'hello world') is passed the code works fine. I don't understand why and also how to solve this?
simplified function code:
var showSinglePrivateMessage = function(privatemessage,wrapper){
console.log('showSinglePrivateMessage()-theprivatemessage: '+privatemessage);
}//showSinglePrivateMessage
UPDATE: added the following function that calls showSinglePrivateMessage
:
var s_message_private_ref = function(theprivatemessage,wrapper){
console.log('s_message_private_ref()-theprivatemessage: '+theprivatemessage['postcontent']);
var testmessagecontent = theprivatemessage['postcontent'];//'een test message';
return '<a id="myprivate_s_messagelink" href="#" onclick="userapp.showSinglePrivateMessage(\'' + testmessagecontent + '\',\'' + wrapper + '\');">'+theprivatemessage['postsubject']+'</a>';
}//message_topic_ref
example string value (some Dutch text;-) ) for privatemessage
(retrieved from the database):
Beste Marie,
Uit onze administratie blijkt een achterstand van betaling.
Gelieve het verschuldigde bedrag van 23.12 over te maken binnen uiterlijk 7 dagen.
Met vriendelijke groet,
Mies
Administratie