[jQuery] Re: passing arguments to javascript function with php

2007-07-20 Thread Karl Rudd
Good point Klaus :). I don't actually use any AJAX in my day to day development, so I'm a bit rusty about how to get it all working. Mike's Form Plugin is definitely the way to go for anything but the simplest AJAX forms. Karl Rudd On 7/20/07, Klaus Hartl <[EMAIL PROTECTED]> wrote: Karl Rudd

[jQuery] Re: passing arguments to javascript function with php

2007-07-20 Thread Klaus Hartl
Karl Rudd wrote: Instead of building a new system entirely use what you have already use "progressive enhancement". You have "delete" buttons, with specific names that correspond with the news items. When they're clicked they submit to a specific URL. What you can do is catch the click and do

[jQuery] Re: passing arguments to javascript function with php

2007-07-20 Thread bytte
Thanks a bunch guys. This is exactly what I was looking for. Also thanks for the ajax=true idea, I like it a lot.

[jQuery] Re: passing arguments to javascript function with php

2007-07-19 Thread Karl Rudd
Instead of building a new system entirely use what you have already use "progressive enhancement". You have "delete" buttons, with specific names that correspond with the news items. When they're clicked they submit to a specific URL. What you can do is catch the click and do the submit via AJA

[jQuery] Re: passing arguments to javascript function with php

2007-07-19 Thread Matt Stith
Sean, numeric IDs are invalid , better to use something like: $("a").click(function(){ $.get("test.php", { id: this.id.substr(this.id.substr(this.id,indexOf('_')+1), action:this.href.substr(this.href.indexOf('#')+1) } ); }); Not tested On 7/19/07, Sean Catchpole <[EMAIL PROTECTED]> wrote: I

[jQuery] Re: passing arguments to javascript function with php

2007-07-19 Thread Sean Catchpole
I believe I made a typo on the this.href.substr(1). Here's is the revised sample: $("a").click(function(){ $.get("test.php", { id: this.id, action:this.href.substr(this.href.indexOf('#')+1) } ); }); ~Sean On 7/19/07, Sean Catchpole <[EMAIL PROTECTED]> wrote: You could save the id in the html

[jQuery] Re: passing arguments to javascript function with php

2007-07-19 Thread Sean Catchpole
You could save the id in the html. Here's an example. $("a").click(function(){ $.get("test.php", { id: this.id, action:this.href.substr(1) } ); }); ~Sean