I have a Javascript where I render a partial using the js.erb:
$('#registration-steps').fadeOut("fast").html("<%= escape_javascript( render :partial => @page, :layout => false )%>").fadeIn("slow");
The problem is, in this partial I have some code from adwords I want to render for conversion tracking:
E.g:
<script type="text/javascript" src="https://www.googleadservices.com/pagead/conversion.js">
When I call the partial however, the script is being stripped and the javascript is not being executed.
I tried the following in my js.erb with no avail:
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = "https://www.googleadservices.com/pagead/conversion.js";
$("#tracking").append(script);