What you are doing is not valid html, you can't put a script tag inside a tr tag. Try something like this:
<tr class="odd" id="{{v.publisher_id}}"> <script type="text/javascript"> showDomainTable('{{v.publisher_id}}', '{{v.country_id}}'); </script> </tr> But even then, inline javascript is something better avoided. I would just create a function that is run as soon as the document is loaded, find all tr's inside your table, and use their id's to call your showDomainTable function. If you also need the country id, something like this could work: <tr class="odd" id="{{v.publisher_id}}_{{v.country_id}}"> And then in your javascript code just split on the underscore. I have no clue if you know jQuery? But this would be very easy if you would use jQuery. If you need it, I could give you some mockup code to help you along. On Dec 27, 7:42 pm, "gilbert F." <gilber...@gmail.com> wrote: > Hello, > > I just wonder if somebody has met this problem. I need to call a > javaScript function within "<tr.....>". > > {% for v in data %} > <tr class="odd" > id="{{v.publisher_id}}" > <script type="text/javascript" > language="JavaScript"> > showDomainTable > ('{{v.publisher_id}}', '{{v.country_id}}'); > </script> > > > > This works well with Firebox but not with IE 8. IE just prints > "showDomainTable(...)" instead of calling it. > > Any help? Thanks so much. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.