Bug Tracker

Modify

Ticket #8217 (closed bug: invalid)

Opened 3 years ago

Last modified 3 years ago

Live on anchor tag / hyperlink

Reported by: mtnbum Owned by: mtnbum
Priority: undecided Milestone: 1.next
Component: unfiled Version: 1.4.4
Keywords: Cc:
Blocking: Blocked by:

Description

The code below works in all browsers when the anchor tag is changed to a paragraph tag. As is, the code works in Safari and Internet Explorer, but works only sporadically in Firefox.

$('a.this').live("click", function() {

$.post("thing.php", {

orgID: this.id.substring(5)

}); return true;

});

Change History

comment:1 Changed 3 years ago by snover

  • Owner set to mtnbum
  • Status changed from new to pending

As per the bug reporting guidelines, please provide a working test case demonstrating this issue.

comment:2 Changed 3 years ago by mtnbum

  • Status changed from pending to new

 http://jsfiddle.net/b2Bkg/

But that's missing the PHP file, the PHP content is here:

<?php echo '<pre>'; print_r($_POST); echo '</pre>'; ?>

A working test is at:

 http://santiamalpineclub.org/jqtest/

And I added a second question. But the main question is, why is Firefox success sporadic when IE and Safari work all the time?

comment:3 Changed 3 years ago by snover

  • Status changed from new to closed
  • Resolution set to invalid

Thanks for the report, but this is not a jQuery bug. You are trying to perform an AJAX request without stopping the default action of the link. When the default action occurs, it begins the process of page unloading, which aborts all active AJAX requests. Please use the  jQuery Forum for support requests.

comment:4 Changed 3 years ago by mtnbum

To test your reply I set return to false. That resolves one problem, but not both. The updated code is at:

 http://santiamalpineclub.org/jqtest/

I will look to the forum if there is an answer there about how to follow an anchor tag after executing the AJAX. I did not find an example on the main jQuery site.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.