<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Jayla,<div class=""><br class=""></div><div class="">The script you generate executes an ajax call to the server to set the value of ‘data-tab’ and the code after that call was generated with the value of ‘self tabId’ at the time of generation (which was probably nil).</div><div class="">Mind that unless you need the ‘data-tab’ value on the server-side, it does not make sense to pass the value to the server, nor to generate this script with Seaside, but this should work:</div><div class=""><br class=""></div><div class="">html document<br class=""><span class="Apple-tab-span" style="white-space:pre">                </span>addLoadScript:<br class=""><span class="Apple-tab-span" style="white-space:pre">                        </span>((html jQuery: 'ul.tabs li')<br class=""><span class="Apple-tab-span" style="white-space:pre">                                </span>onClick:<br class=""><span class="Apple-tab-span" style="white-space:pre">                                        </span>(html jQuery ajax<br class=""><span class="Apple-tab-span" style="white-space:pre">                                                </span>callback: [ :val | self tabId: val ]<br class=""><span class="Apple-tab-span" style="white-space:pre">                                                </span>value: (html jQuery this attributeAt: 'data-tab’);</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                                                </span>script: [:s | s &lt;&lt;&nbsp;<br class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="Apple-tab-span" style="white-space:pre">        </span>((s jQuery: 'ul.tabs li') removeClass: 'current'),<br class=""><span class="Apple-tab-span" style="white-space:pre">                                                </span>&nbsp;<span class="Apple-tab-span" style="white-space:pre">        </span>((s jQuery: '.tab-content') removeClass: 'current'),<br class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="Apple-tab-span" style="white-space:pre">        </span>(s jQuery this addClass: 'current'),<br class=""><span class="Apple-tab-span" style="white-space:pre">                                                        </span>((s jQuery id: self tabId) addClass: 'current’)) ]).</div><div class=""><br class=""></div><div class="">The important part to understand here is _when_ the script is generated. If it needs a value from the server, you can only generate it when the server has that value.</div><div class=""><br class=""></div><div class="">Hope this helps,</div><div class="">Johan</div><div class=""><br class=""></div><div class=""><div><blockquote type="cite" class=""><div class="">On 06 Nov 2015, at 04:02, Jayalakshmi Lade &lt;<a href="mailto:jayalakshmi.lade@solteco.biz" class="">jayalakshmi.lade@solteco.biz</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi,<div class=""><br class=""></div><div class="">I am new to jQuery in seaside and trying to convert the below jQuery script to seaside jQuery for activating tabs and to render the related data but on another tab click getting <b class="">val</b> as 'undefined'.&nbsp;</div><div class=""><br class=""></div><div class=""><b class="">jQuery script:</b></div><div class=""><br class=""></div><div class=""><div class="">$(document).ready(function(){</div><div class=""><span class="" style="white-space:pre">        </span></div><div class=""><span class="" style="white-space:pre">        </span>$('ul.tabs li').click(function(){</div><div class=""><span class="" style="white-space:pre">                </span>var tab_id = $(this).attr('data-tab');</div><div class=""><br class=""></div><div class=""><span class="" style="white-space:pre">                </span>$('ul.tabs li').removeClass('current');</div><div class=""><span class="" style="white-space:pre">                </span>$('.tab-content').removeClass('current');</div><div class=""><br class=""></div><div class=""><span class="" style="white-space:pre">                </span>$(this).addClass('current');</div><div class=""><span class="" style="white-space:pre">                </span>$("#"+tab_id).addClass('current');</div><div class=""><span class="" style="white-space:pre">        </span>})</div><div class="">})</div><div class=""><br class=""></div><div class=""><b class="">My Converted jQuery code in seaside:</b></div><div class=""><br class=""></div><div class=""><div class="">html document</div><div class=""><span class="" style="white-space:pre">                </span>addLoadScript:</div><div class=""><span class="" style="white-space:pre">                        </span>((html jQuery: 'ul.tabs li')</div><div class=""><span class="" style="white-space:pre">                                </span>onClick:</div><div class=""><span class="" style="white-space:pre">                                        </span>(html jQuery ajax</div><div class=""><span class="" style="white-space:pre">                                                </span>callback: [ :val |&nbsp;self tabId: val ]</div><div class=""><span class="" style="white-space:pre">                                                </span>value: (html jQuery this attributeAt: 'data-tab')),</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;((html jQuery: 'ul.tabs li') removeClass: 'current'),</div><div class=""><span class="" style="white-space:pre">                                                 </span>((html jQuery: '.tab-content') removeClass: 'current'),</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(html jQuery this addClass: 'current'),</div><div class=""><span class="" style="white-space:pre">                                                </span>((html jQuery id: self tabId) addClass: 'current')).</div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Please give me your valuable suggestions on this.&nbsp;</div><div class="">Thank you and looking forward for your reply.<br class=""><br class=""><div class="gmail_signature"><div dir="ltr" class=""><p class=""><b class=""><span style="font-size:10pt;line-height:115%;font-family:'Monotype Corsiva'" class="">Regards,</span></b></p><div class="">

<br class="webkit-block-placeholder"></div><p class=""><b class=""><span style="font-size:10pt;line-height:115%;font-family:'Monotype Corsiva'" class="">Jaya L</span></b></p></div></div>
</div></div></div>
</div></blockquote></div><br class=""></div></body></html>