I have an issue with onclick function.
Here's my code :
$('ul.listing').append('<button onclick="openInApp("test")" class="btn btn-primary">Edit <i class="fa fa-external-link" aria-hidden="true"></i></button>');
When I click the button, I have the "Unexpected end of input" error message.
I try to pass variable too like this :
$('ul.listing').append('<button onclick="openInApp('+ edit_url +')" class="btn btn-primary">Edit <i class="fa fa-external-link" aria-hidden="true"></i></button>');
And I get the following message : Uncaught SyntaxError: missing ) after argument list
Both errors begins at the "("
I have another function (always in the append) :
$('ul.listing').append('<a href="event-details.html" onclick="saveEventID(' + data[i].ID + ');">')
And it works perfectlly
I don't understand
onclick="openInApp("test")", only"openInApp("is passed to the onclick listeneron.