Sean, numeric IDs are invalid , better to use something like:

<a id="post_345" href="#delete">
$("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 believe I made a typo on the this.href.substr(1). Here's is the revised
sample:
<a id="345" href="#delete">
$("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. Here's an example.
> <a id="345" href="#delete">
>  $("a").click(function(){
>   $.get("test.php", { id: this.id, action:this.href.substr (1) } );
> });
>
> ~Sean


Reply via email to