Hello,
In a controller I try to render a javascript google ad to print it into some HTML using JSONP, like this
<script type="text/javascript"><!--
google_ad_client = "pub-23222424";
google_alternate_color = "FFFFFF";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript"
src="http://pagead2.google.com/pgad/show_ads.js">
</script>
So I do:
render :text "var s_response = { content: '<script type=\"text/javascript\"><!--\\ngoogle_ad_client = \"pub-23222424\";\\ngoogle_alternate_color = \"FFFFFF\";\\ngoogle_ad_width = 468;\\ngoogle_ad_height = 60;\\n//--><\\/script>\\n<script type=\"text/javascript\"\\n src=\"http://pagead2.google.com/pgad/show_ads.js\">\\n<\\/script>', id: '2'};">
But i get this error:
unterminated string literal
[Break on this error] var response = { content: '<script type="text/javascript"><!--
=> That seems like it is a multilines problem right ? But I don't know how to resolve it.
Thanks,
Lucas