Bug Tracker

Modify

Ticket #5435 (closed bug: invalid)

Opened 4 years ago

Last modified 4 years ago

$.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:
Blocking: Blocked by:

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

comment:1 Changed 4 years ago by dmethvin

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

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.

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.