I have an innerHTML declared as follows:
newdiv.innerHTML = '<a href=\'#\' onclick=genGroups('+userid+',\''+coursename+'\','+url+')>'+coursename+'</a>';
I cant send any url and/or string variable(e.g coursename which has spaces in it) through the onclick. The error related to space(incase of string) and url(need a')' after argument) occurs. Any idea?