Discussion:
bizar z3c.pt error
Wichert Akkerman
2008-08-17 23:45:52 UTC
Permalink
I just ran into a quite bizar error. This bit of template:

<script type="text/javascript">
var brands = [
<py:for each="brand in c.brands">
{ value : "${brand['id']}", "title" : "${brand['title']}" },
</py:for>
];

$(document).ready(function () {
$("fieldset#images div.imageField:nth-child(4)")
.addClass("last")
.after("<hr/>");


produced this output when rendered:

323 <script type="text/javascript">
323 var brands = [
324
325 { value : "2", "title" : "EDC" },
326
327 ];
328
329$(document).ready(function () {
330 $("fieldset#images div.imageField:nth-child(4)")
331 .addClass("last")
332 .after("
333 { value : "3", "title" : "Prada" },
334
335 ];
336
337$(document).ready(function () {
338 $("fieldset#images div.imageField:nth-child(4)")
339 .addClass("last")
340 .after("
341 { value : "1", "title" : "Smile!" },
342
343 ];

I haven't been able to turn that into a test I'm afraid.

Wichert.
--
Wichert Akkerman <***@wiggy.net> It is simple to make things.
http://www.wiggy.net/ It is hard to make things simple.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "z3c.pt" group.
To post to this group, send email to ***@googlegroups.com
To unsubscribe from this group, send email to z3c_pt+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/z3c_pt?hl=en
-~----------~----~----~----~------~----~------~--~---
Wichert Akkerman
2008-08-17 23:54:15 UTC
Permalink
Post by Wichert Akkerman
<script type="text/javascript">
var brands = [
<py:for each="brand in c.brands">
{ value : "${brand['id']}", "title" : "${brand['title']}" },
</py:for>
];
$(document).ready(function () {
$("fieldset#images div.imageField:nth-child(4)")
.addClass("last")
.after("<hr/>");
323 <script type="text/javascript">
323 var brands = [
324
325 { value : "2", "title" : "EDC" },
326
327 ];
328
329$(document).ready(function () {
330 $("fieldset#images div.imageField:nth-child(4)")
331 .addClass("last")
332 .after("
333 { value : "3", "title" : "Prada" },
334
335 ];
336
337$(document).ready(function () {
338 $("fieldset#images div.imageField:nth-child(4)")
339 .addClass("last")
340 .after("
341 { value : "1", "title" : "Smile!" },
342
343 ];
I haven't been able to turn that into a test I'm afraid.
Slightly simpler variants:

<script type="text/javascript">
var brands = [
<py:for each="brand in c.brands">
{ value : "${brand['id']}", "title" : "${brand['title']}" },
</py:for>
];
</script>

results in:

<script type="text/javascript">
var brands = [

{ value : "2", "title" : "EDC" },

];

{ value : "3", "title" : "Prada" },

];

{ value : "1", "title" : "Smile!" },

];
</script>

Wichert.
--
Wichert Akkerman <***@wiggy.net> It is simple to make things.
http://www.wiggy.net/ It is hard to make things simple.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "z3c.pt" group.
To post to this group, send email to ***@googlegroups.com
To unsubscribe from this group, send email to z3c_pt+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/z3c_pt?hl=en
-~----------~----~----~----~------~----~------~--~---
Loading...