EDIT: the 'more' link is built from here:
document.getElementById("elenco_fiveboard").insertAdjacentHTML('beforeend',
"<li>" +
"Titolo: " + valore_comando + " " +
"(<a href='javascript:getInfo("+ valore_comando +");'>" +
"more" + "</a>)" +
"</li>");
So I have to wrap valore_comando with hyphens but I get error trying to write
"(<a href='javascript:getInfo(""+ valore_comando +"");'>" +
or
"(<a href='javascript:getInfo('"+ valore_comando +"');'>" +
Sorry but I am not so strong with JS syntax and I am starting from some code that is not my own.
I have this simple JS function:
getInfo = function(title){
worker.port.postMessage("maggiori_informazioni:" + title);
}
I run it passing to the variable title a value but I always get an error. If title is 'example' then JS try to run
getInfo = function(example)
and I get the error:
Reference Error: example is not defined. If title has more than one word: 'first example' then JS will try to run
getInfo = function(first example)
and I get the error:
Syntax error: missing ) after argument list (looking for parentesys after 'first').
What am I missing here?? This code is part of my first test with webSockets. If you want to see the full code you can open this index page and put a value on the first alert you see. That value is the title that you will see on the dashboard page. The error can be reproduced trying to hit 'More' after each defined title in dashboard. Sorry for italian in the site but it's a user requirement.
getInfo("this is a title");