Comment 3 for bug 364684

Revision history for this message
Abel Deuring (adeuring) wrote : Re: [Bug 364684] [NEW] The javascript code contained in bugtask-index.pt should go into a separate file

On 22.04.2009 19:16, Björn Tillenius wrote:
> On Tue, Apr 21, 2009 at 03:42:44PM -0000, Abel Deuring wrote:
>> (2) If a '"' (double quotation mark) appears in JS, we'll get an error when the template is parsed. This leads to ugly, difficult to read code like node.set('innerHTML', '<a id=\'x\' class=\'y\' href=\'z\'>')
>
> This is because we use tal:replace="string: $js-code", in order to be
> able to easily customize the code, getting data from python. Moving the
> code to a separate file won't make this any better.
>

When we load the JS code via <script type="text/javascript"
src="https://..."> we can avoid these escapes. I also noticed that "make
lint" catches some problems in "real" JS files which remain unnoticed if
the JS code is embedded in a page template.