Great. Thanks Kevin! On Dec 29, 1:28 am, Kevin Renskers <i...@bolhoed.net> wrote: > First of all, in your template include jQuery: > <script type="text/javascript" src="http://ajax.googleapis.com/ajax/ > libs/jquery/1.3/jquery.min.js"></script> > > Create a new javascript file, and put the following code in it: > > // This is automatically run when the document has been completely > loaded > $(function() { > // Find all tr's in your table (give your table an id) > $('#your_table_id tr').each(function() { > // Give your tr's an id like {{v.publisher_id}}_ > {{v.country_id}} > // We now split that id on the underscore and get the parts we > need. > temp = this.id.split('_'); > publisher_id = temp[0]; > country_id = temp[1]; > > // Call your function however you like > showDomainTable(publisher_id, country_id); > }); > > }); > > Include this new javascript in your template too, and give your table > an id. > This code is just from the top of my head, but it should work alright. > > On Dec 28, 11:24 pm, "gilbert F." <gilber...@gmail.com> wrote: > > > Hi Kevin, > > > Sorry I could not make progress therefore I am considering to use > > jQuery. As I never used it, can I have your jQuery code for reference? > > You may send to my e-mail gilber...@gamil.com > > > Thanks so much. > > > On Dec 28, 9:19 am, "gilbert F." <gilber...@gmail.com> wrote: > > > > Hi Kevin, > > > > Thanks so much for your replies. Following your suggestions I have > > > moved tag <script> out of <tr>. > > > > <tr class="odd" id="{{v.publisher_id}}"> > > > <script type="text/javascript"> > > > showDomainTable('{{v.publisher_id}}', '{{v.country_id}}'); > > > </script> > > > </tr> > > > > Sorry I do not know jQuery. For the moment let me follow your > > > suggestions and move forward. If I can not succeed then I will > > > consider jQuery. > > > > Thanks again. Appreciated. > > > > On Dec 28, 2:31 am, Masklinn <maskl...@masklinn.net> wrote: > > > > > On 28 déc. 2009, at 10:26, Kevin Renskers <i...@bolhoed.net> wrote: > > > > > > But even then, inline javascript is something better avoided. > > > > > Especially, in this case, because there is no garantee whatsoever that > > > > the element has already been created and added to the document's DOM.- > > > > Hide quoted text - > > > > - Show quoted text -
-- 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.