Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeder.erje.net!news-1.dfn.de!news.dfn.de!news.informatik.hu-berlin.de!fu-berlin.de!uni-berlin.de!not-for-mail From: Jake Jarvis Newsgroups: comp.lang.javascript Subject: Re: onclick=function(){obj.meth()} Date: Mon, 20 Feb 2012 20:39:07 +0100 Lines: 23 Message-ID: <9qflqrFfeeU1@mid.uni-berlin.de> References: <4f429d06$0$6981$e4fe514c@news2.news.xs4all.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de MQK8kUNrP0HEkLzYKNPF3ArHOeWN6b6afl7YNWI5cMmQ//Deg= User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 In-Reply-To: <4f429d06$0$6981$e4fe514c@news2.news.xs4all.nl> Xref: x330-a1.tempe.blueboxinc.net comp.lang.javascript:11958 On 20.02.2012 20:20, Tom de Neef wrote: > "Puzzled" schreef in bericht > news:jp45k75qbcjbb5v8tavnmognds11hjihdh@4ax.com... >> >> function row( i ) >> { >> var rec_s = '> 'id="foo'+i+'" '+ >> 'onclick=function(){alert('+i+')}>'+i+''+ >> ''; >> return rec_s ; >> } >> > > This function compiles in FF and JSlint doesn't complain either. > It's not about just compiling/passing as syntactically valid js program on the first level, the real problem manifests itself "later", when actually clicking the resulting anchor. -- Jake Jarvis