Javascript issue inside of a Python Module
<p>I'm trying to have Python run some Javascript, and I am running into a few issues. Namely that when I am trying to inject some text into a textarea of a page, it doesn't seem to work if and only if there is a newline (\n) as part of the variable inserted for the Javascript.</p>

<p>Here's my line:</p>

<pre><code>br.runjs("document.getElementById('edit-body').value = '%s'" % (brag))
</code></pre>

<p>if the variable "brag" has any sort of newline in it at all, the insertion does not work. Any idea how to go around this?</p>
