Skip to main content

Bug Tracker

Side navigation

#7804 closed bug (worksforme)

Opened December 18, 2010 04:12AM UTC

Closed December 18, 2010 12:06PM UTC

function runs multiple times

Reported by: anonymous Owned by:
Priority: undecided Milestone: 1.6
Component: unfiled Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:
Description

The following works correctly the first time. But if clicked again before a page refresh or page reload, it runs 2 or sometimes more times. Even after adding the $(this).unbind(); line.

$(document).ready(function() {
$("a#searchowner").click(function() {
var searchval=$("#p1").val(); 
  alert(searchval);
  $.post("findowner.php", {p1 : searchval}, function(data){
   if (data.length>0){ 
     //$("#ownerIDdiv2").fadeIn(1000).html(data);
	 $("#ownerIDdiv2").html(data); 
   } 
  }) 
   
$(this).unbind(); 
});
});   ///////////////end//////////////////////////
Attachments (0)
Change History (1)

Changed December 18, 2010 12:06PM UTC by jitter comment:1

resolution: → worksforme
status: newclosed

Thanks for taking the time to contribute to the jQuery project by writing a bug report.

I made a live test case and couldn't reproduce what you described. Please report back if you can provide a test case which reproduces your problem (ideally on http://jsfiddle.net) so that we can investigate this issue further.