I'm trying to build a string inside <script></script> which has a variable.
var buildurl = response.show.url;
var connectHtml = '<button class="form_button" id="connectButton" onclick="window.location='+buildurl+'">Connect</button>'
$('#someElement').html(connectHtml);
When I inspect the element, I see the url built but without the single quotes (''). So when I click on the button, it does not navigate to the url. How can I add the '' to get
onclick="window.location='https://something.com/admin/one/two/123/456'" ?
<button class="form_button" id="connectButton" onclick="window.location=https://something.com/admin/one/two/123/456">Connect</button>
onclick="window.location=\''+buildurl+'\'"