Skip to main content

Bug Tracker

Side navigation

#7735 closed bug (invalid)

Opened December 09, 2010 11:22AM UTC

Closed December 10, 2010 04:28PM UTC

Cannot use .click() after ajax post

Reported by: dosty85@gmail.com Owned by: dosty85@gmail.com
Priority: undecided Milestone: 1.6
Component: unfiled Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:
Description

My code:

// REFRESH BUTTON
var txt = $("#refresh").html();
$("#refresh").click(function(){
	$(this).html('Loading..');
   	$("#qq-upload-showThumbs").fadeTo(0.5,0.4);
	$("#qq-upload-showThumbs").load("./seephp/fileuploader-showdir/", {path: "/upload/", showType: "xyz" },function(){
		$("#refresh").html(txt);
		$("#qq-upload-showThumbs").fadeTo(0.5,1.0);
		$("span.qq-upload-delete").click(function(){
			var id = $(this).attr('id');
			id = id.split('-');
			$.post("/seephp/fileuploader-delete/",{path:'myPath', name:id[1]},function(data){
				
				$("#refresh").click(); // THIS IS A PROBLEM, DONT WORK IN 1.4.4, BUT WORK IN 1.3.2
				
			});
			return;
		});
		...
	});
});					
Attachments (0)
Change History (4)

Changed December 09, 2010 12:32PM UTC by jitter comment:1

_comment0: Thanks for taking the time to contribute to the jQuery project by writing a bug report.\\\\ \ Thanks for taking the time to contribute to the jQuery project by writing a bug report. \ ----- \ [http://docs.jquery.com/How_to_Report_Bugs How to report bugs]1291898005280157
owner: → dosty85@gmail.com
status: newpending

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

Please submit a reduced test case, which reproduces the issue you are experiencing, on http://jsfiddle.net. So that we can investigate this issue further.


How to report bugs

Changed December 10, 2010 02:18PM UTC by anonymous comment:2

Here is http://jsfiddle.net/qerZ9/1/ this is work. But I must modify my code. Originally is:

$("#qq-upload-showThumbs").load("./seephp/fileuploader-showdir/", {path: "/upload/", showType: "xyz" },function(){

instead

$.post("./seephp/fileuploader-showdir/", {path: "/upload/", showType: "xyz" },function(data){
 $("#qq-upload-showThumbs").html(data);
}

Version on http://jsfiddle.net/qerZ9/1/ work fine, with load I cannot simulate. Have I send some ZIP file with source?

Changed December 10, 2010 02:49PM UTC by anonymous comment:3

And I Forgot, this problem is in Google Chrome. In Opera and IE8 work code fine.

Changed December 10, 2010 04:28PM UTC by rwaldron comment:4

resolution: → invalid
status: pendingclosed

This is not a jQuery bug - the event handler you should use is live or delegate.

http://api.jquery.com/live/

http://api.jquery.com/delegate/