I'm passing about 5 parameters to the function that are coming from php running in a loop. So I was thinking I needed to use the onclick on the <a> tag so that I could just pass the php variables as parameters right there in the loop instead of storing them somehow and referencing them after the page load.
On Nov 11, 10:54 am, Joe Moore <joe.lynn.mo...@gmail.com> wrote: > Is there some reason you don't want to put this onclick event in a script > tag in the head section? Like, > > <html> > <head> > <title>Test Page</title> > <script src='jquery.js' type='text/javascript'></script> > <script type="text/javascript"> > $(function() { > $('a.detailLink').click( > function(event) { > //stop the events default action - stops click. > event.preventDefault(); > //stop propagation so the event doesn't bubble up. > event.stopPropagation(); > //run custom function. > cutsom_function(parameters); > } > ); > }); > </script> > </head> > <body> > <a id='link1' class="detailLink" href="#">More Details</a> > </body> > </html> > > HTH, > > Joe > > On Wed, Nov 11, 2009 at 1:14 PM, Matthew <mvbo...@gmail.com> wrote: > > I posted this earlier, but perhaps I didn't explain it right. > > > Im trying to get code that uses this syntax to work in IE6/7 > > > <a href="some link" onclick="$(this).function(parameters); return > > false;"> > > > It seems like IE6/7 do not like the $(this).function syntax, although > > if I just alert($(this)) I get [object Object] which I think is what > > should be expected. > > > I am using a custom jQuery plugin. A watered down version can be seen > > here:http://jsbin.com/ehoxu > > > Thanks in advance. > >