[jQuery] Re: How to get the responsetext with $.ajax
I do have something h looking like your code taht works fine. I do return result in a div : ___ $.ajax({ type: "POST", url: "get_opened_all.php", data: "from_date="+$('input#from_date').val()+"&to_date="+$ ('input#to_date').val()+"&who="+$('#who').val(), async: false, success: function(data){ $("#opened_all").empty().append(data); } }); On Dec 9, 2:55 pm, ftw wrote: > hi, > I'am using jquery to get a response from a php page, here it is : > > function verif(thediv) > { > var xhr = $.ajax({ > type: "POST", > url: "some.php", > data: "name=some variable", > success: function(msg){ > > var reponse = xhr.responseText; > alert("here : "+reponse); > > } > }); > > } > > I tried many things there is no way to get the responseText (that should be > yes or no), i want absolutly to use a asynchrone methode (the method with > the async : false, don't helpe me at all :wistle: ) > > Thank you for any help :handshake: > -- > View this message in > context:http://old.nabble.com/How-to-get-the-responsetext-with-%24.ajax-tp267... > Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Selector issue
Well I dont think I'll have more than about 15 childs here. Thx for help On 4 déc, 17:09, MorningZ wrote: > I wouldn't suggest going the ".live" route if you plan on having a lot > of children of "cat_list" > > using event delegation, there is one single event wired up that > handles 1 child or 1200 children > > using ".live", you would have N number of events sitting there wired > up where N is the number of children. but whatever works i > suppose > > On Dec 4, 3:35 am, Civette wrote: > > > Well, after a few tests, this works fine : > > > $("#cat_list > div").live("click", function() > > { alert($(this).attr("id")); > > > }); > > > thanx
[jQuery] Re: Selector issue
Well, after a few tests, this works fine : $("#cat_list > div").live("click", function() { alert($(this).attr("id")); }); thanx
[jQuery] Re: Selector issue
Is your issue description linked to this : http://forum.jquery.com/viewtopic.php?f=2&t=1000&sid=7932d86732f0126e2c4ad3f5e92baa4d Same thing ? On Dec 3, 10:52 pm, MorningZ wrote: > if those 's are dynamically added, which it sounds like is the > case, then the "new" 's do not get wired automatically... <- > this is easily the most common trip-up seen on this mailing list > > Event Delegation would be your friend here > > http://jsbin.com/ivivo/edit > > that way the container event "cat_list" has the event and you can add/ > remove children from it as you please > > On Dec 3, 4:10 pm, Civette wrote: > > > Well, actually my div "39", "40", are returned in the cat_list > > div from a previous ajax query. Numbers are in fact the autoincrement > > id's in a mysql table. > > > Point is, on clicking each, to edit it. > > > That specific javascript part is returned by that ajax query.
[jQuery] Re: Selector issue
I'll test it tomorrow. Thx for answer
[jQuery] Re: Selector issue
Well, actually my div "39", "40", are returned in the cat_list div from a previous ajax query. Numbers are in fact the autoincrement id's in a mysql table. Point is, on clicking each, to edit it. That specific javascript part is returned by that ajax query.
[jQuery] Selector issue
Well i'm in trouble. Following code does not trigger : Code: Select all $("#cat_list > div").click(function() { alert("Bye bye!");; }); neither Code: Select all $("#cat_list ~ div").click(function() { alert("Bye bye!");; }); or Code: Select all $("#cat_list > *").click(function() { alert("Bye bye!");; }); Altough this works : Code: Select all $("#cat_list").click(function() { alert("Bye bye!");; }); HTML code looks like : a b ... Any idea ? thanks