Bug Tracker

Opened 10 years ago

Closed 10 years ago

#5435 closed bug (invalid)

$.get(url,fn,'json'),$.getJSON do not work in live event's callback

Reported by: doutu Owned by:
Priority: major Milestone: 1.4
Component: unfiled Version: 1.3.2
Keywords: Cc:
Blocked by: Blocking:

Description

http://localhost/json echo {id:1,name:"json in live"}

$('a.json').live('click',function(e){

$.getJSON('http://localhost/json.php',function(m){

for(var x in m){ $(x).val(m[x]);alert(x)}

});

});

Change History (1)

comment:1 Changed 10 years ago by dmethvin

Resolution: invalid
Status: newclosed

Given the partial code above it looks like the loop would execute twice:

  $("id").val(1); alert(1);
  $("name").val("json in live"); alert("name");

That doesn't make any sense to me.

Please reopen and attach a complete test case -- the minimal but complete html and javascript required to reproduce the problem. Or, if you really intended to write that code, please ask for help on the forums instead.

Note: See TracTickets for help on using tickets.