When i add onclick to my jquery it goes wrong
I have this code that works fine but as soon as i add values to the openInDialog functioni get errors.
Here it is without the values
- function putContent(data){
- jQuery('#dis-wrapper').empty();
- for(var i= 0 ;i<data.length;i++){
- jQuery('#dis-wrapper').append('<div class="list-group-item"><a href="#" onclick="openInDialog();"><h4 class="list-group-item-heading">'+ data[i]['Title'] +'</h4></a><div class="list-group-item-text">'+data[i]['Created']+'</div></div>');
- }
As soon as i add values like this i get the following error
uncaught SyntaxError: Unexpected token ILLEGAL
And for information if i use the onclick with a static html page it works fine
- function putContent(data){
- jQuery('#dis-wrapper').empty();
- for(var i= 0 ;i<data.length;i++){
- jQuery('#dis-wrapper').append('<div class="list-group-item"><a href="#" onclick="openInDialog(500,600,true,true,true,'/sites/ddeb/dispform.aspx?ID=1);"><h4 class="list-group-item-heading">'+ data[i]['Title'] +'</h4></a><div class="list-group-item-text">'+data[i]['Created']+'</div></div>');
- }
- }