[jQuery] Re: hide()
Great, thank you very much, Aeron. Using class as you suggested is what I'll do. Aaron Gundel wrote: http://www.w3.org/TR/html4/struct/global.html#adef-id HTML standards state that the id attribute should be unique in an html document. Use class or somesuch. Then you can do something like $(.trContactInfo).hide() and it will hide everything. A. Gundel On Sun, Feb 8, 2009 at 1:30 PM, WebAppDeveloper minhle0...@yahoo.com wrote: Hi, If I have an html table with 3 rows each with the same id, for example, id=trContactInfo, as in the html code below. Using jQuery, if I want to hide these 3 rows with the same id, i would do something like $(tr#trContactInfo).hide().next().hide().next().hide. My question is: Instead of running hide() 3 times, is there a way to hide all the rows with the same id by looping thru all the rows, basically these 3 rows plus any new rows that may be added to the table with the same id in the future? table tr id=trContactInfo tdFull Name:/td tdinput type=text name=FullName size=40/td /tr tr id=trContactInfo tdE-mail:/td tdinput type=text name=Email size=40/td /tr tr id=trContactInfo tdPhone:/td tdinput type=text name=Phone size=40/td /tr tr tdField 4:/td tdinput type=text name=Field4 size=40/td /tr tr tdField 5:/td tdinput type=text name=Field5 size=40/td /tr tr tdField 6:/td tdinput type=text name=Field6 size=40/td /tr /table Thanks very much in advance. -- View this message in context: http://www.nabble.com/hide%28%29-tp21886844s27240p21886844.html Sent from the jQuery General Discussion mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/hide%28%29-tp21886844s27240p21907411.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] error option for jQuery.ajax
Hi, I have the following code below where I'm trying to dynamically check if an AJAX request error occurs. If an error occurs, do something; otherwise, do something else (if it's a success). But according to jQuery.com, they say You can never have both an error and a success callback with a request. And that's why I'm getting an error when running the code below. Is there a way to solve this? $(document).ready(function() { $.ajax({ type: GET, url: SomeProcessPage.cfm, data: FirstName=JerryLastName=Young, success: function(data) { $(data).appendTo(#myDivId); } error: function(XMLHttpRequest, textStatus, errorThrown){ $(#msg).ajaxError(function(event, request, settings){ $(this).append(liError requesting page + settings.url + /li); }); } }); }); -- View this message in context: http://www.nabble.com/error-option-for-jQuery.ajax-tp20711274s27240p20711274.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: error option for jQuery.ajax
Great. I'll try it out when I return to work next week. Thank you so much! seasoup wrote: Your getting an error in that code because you need a comma after the success:function(){}, Also, make sure there is no comma after the last method in the object or IE throws an error. Josh Powell On Nov 26, 11:51 pm, WebAppDeveloper [EMAIL PROTECTED] wrote: Hi, I have the following code below where I'm trying to dynamically check if an AJAX request error occurs. If an error occurs, do something; otherwise, do something else (if it's a success). But according to jQuery.com, they say You can never have both an error and a success callback with a request. And that's why I'm getting an error when running the code below. Is there a way to solve this? $(document).ready(function() { $.ajax({ type: GET, url: SomeProcessPage.cfm, data: FirstName=JerryLastName=Young, success: function(data) { $(data).appendTo(#myDivId); } error: function(XMLHttpRequest, textStatus, errorThrown){ $(#msg).ajaxError(function(event, request, settings){ $(this).append(liError requesting page + settings.url + /li); }); } });}); -- View this message in context:http://www.nabble.com/error-option-for-jQuery.ajax-tp20711274s27240p2... Sent from the jQuery General Discussion mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/error-option-for-jQuery.ajax-tp20711274s27240p20725653.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.