I'm trying to pass java script code to the script tag and it is being displayed as plain text. How should i correctly pass the object so that the value is populated correctly
var script = $('<script>', {
type: 'text/javascript',
src: 'mcbz.com/models?type=c43&geo=true&languageselected='+ window.location.pathname.substring(1,6)
});
script[0].setAttribute("async", "");
$('script:first').before(script);
Expected result
<script async src="mcbz.com/models?type=c43&geo=true&languageselected=en" ></script>