hello there, im having a little problem with Internet Exploiter, im doing this: //// CODE //// var m = $(''XYZ'').cloneNode(false) m.setAttribute(''id'', ''XYZ_2''); m.value = ''''; var onblur = "alert(''hola'');"; m.setAttribute(''onblur'', onblur); y6.appendChild(m); //// CODE //// where "XYZ" is an input text and y6 is a TD cell, this works perfectly in firefox, but i dont have idea why doesnt work in IE, any clue?? thx in advance :) -- // // Ing. Francisco J. Calderón S. // fjcalderon-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org // Usuario de GNU/Linux nº 349529 // Maracay, Venezuela // _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Make sure you have tbody tags wrapping your rows or it wont work in IE. <http://zend.com/zce.php?c=ZEND002524&r=212822110> Jon Whitcraft Indianapolis Motor Speedway jwhitcraft-1LwPDYEpVrH2eFz/2MeuCQ@public.gmane.org Phone: (317) 492-8623 :: Fax: (317) 492-6419 ________________________________ From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Francisco Calderon Sent: Thursday, April 06, 2006 11:03 AM To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: [Rails-spinoffs] problem with IE hello there, im having a little problem with Internet Exploiter, im doing this: //// CODE //// var m = $(''XYZ'').cloneNode(false) m.setAttribute(''id'', ''XYZ_2''); m.value = ''''; var onblur = "alert(''hola'');"; m.setAttribute(''onblur'', onblur); y6.appendChild(m); //// CODE //// where "XYZ" is an input text and y6 is a TD cell, this works perfectly in firefox, but i dont have idea why doesnt work in IE, any clue?? thx in advance :) -- // // Ing. Francisco J. Calderón S. // fjcalderon-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org // Usuario de GNU/Linux nº 349529 // Maracay, Venezuela // ******************** ******************** This E-mail (and attachments) may contain confidential/privileged information intended only for the named addressee(s). If you are not an intended recipient, do not read, copy, disseminate or take any action based on the content of this E-mail. Please notify the sender by reply E-mail and erase this E-mail from your system. Your assistance is appreciated. E-mail transmission may not be secure or error-free. The company is not responsible for any loss/damage arising from any virus transmitted. ******************** ******************** _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
On Thursday 06 April 2006 08:02, Francisco Calderon wrote:> hello there, im having a little problem with Internet Exploiter, im doing > this: > > //// CODE //// > var m = $(''XYZ'').cloneNode(false) > m.setAttribute(''id'', ''XYZ_2''); > m.value = ''''; > var onblur = "alert(''hola'');"; > m.setAttribute(''onblur'', onblur); > y6.appendChild(m); > //// CODE //// > > where "XYZ" is an input text and y6 is a TD cell, this works perfectly in > firefox, but i dont have idea why doesnt work in IE, any clue??there could be a couple of issues. IE might not like to use setAttribute to change the value of the ''id'' attribute, so you might have to just do something like: m.id=''XYZ_2''; it also might not like trying to add a td to a tr. putting a try/catch around the whole thing might provide useful information. -Jeremy -- Jeremy Kitchen ++ kitchen-RA8HwDor7flnDGu+y90WmgC/G2K4zDHf@public.gmane.org In the beginning was The Word and The Word was Content-type: text/plain -- The Word of Bob. And the lord said unto John; Come forth and receive eternal life. John came fifth and won a toaster. _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
I thought that was only the case for adding TR elements. I suppose it likely applies to adding TD elements, but he''s trying to add an INPUT inside a TD. I''ve never had need to add TBODY tags in that case. Make sure the ''cloneNode'' function is supported by IE. I''ve never used it myself, so I have no idea if it is. Another possibility is naming your function ''onblur''. IE has a lot more reserved words than Firefox. For example, you can''t do something like this in IE: var myObj = { class: ''blah'' }; because ''class'' is a reserved word in IE. Works great in Firefox, though. Not sure if ''onblur'' is the same or not, but it''s worth looking into. Also, check into ''setAttribute''. IE may not work with that either, or maybe just in certain circumstances. An alternative to your setAttribute calls: m.id = ''XYZ_2''; m.value = ''''; Event.observe(m, ''blur'', function () { alert(''hola''); } ); Good luck. Greg ________________________________ From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Whitcraft, Jon Sent: Thursday, April 06, 2006 10:48 AM To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: RE: [Rails-spinoffs] problem with IE Make sure you have tbody tags wrapping your rows or it wont work in IE. <http://zend.com/zce.php?c=ZEND002524&r=212822110> Jon Whitcraft Indianapolis Motor Speedway jwhitcraft-1LwPDYEpVrH2eFz/2MeuCQ@public.gmane.org Phone: (317) 492-8623 :: Fax: (317) 492-6419 ________________________________ From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Francisco Calderon Sent: Thursday, April 06, 2006 11:03 AM To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: [Rails-spinoffs] problem with IE hello there, im having a little problem with Internet Exploiter, im doing this: //// CODE //// var m = $(''XYZ'').cloneNode(false) m.setAttribute(''id'', ''XYZ_2''); m.value = ''''; var onblur = "alert(''hola'');"; m.setAttribute(''onblur'', onblur); y6.appendChild(m); //// CODE //// where "XYZ" is an input text and y6 is a TD cell, this works perfectly in firefox, but i dont have idea why doesnt work in IE, any clue?? thx in advance :) -- // // Ing. Francisco J. Calderón S. // fjcalderon-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org // Usuario de GNU/Linux nº 349529 // Maracay, Venezuela // ******************** ******************** This E-mail (and attachments) may contain confidential/privileged information intended only for the named addressee(s). If you are not an intended recipient, do not read, copy, disseminate or take any action based on the content of this E-mail. Please notify the sender by reply E-mail and erase this E-mail from your system. Your assistance is appreciated. E-mail transmission may not be secure or error-free. The company is not responsible for any loss/damage arising from any virus transmitted. ******************** ******************** _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
hi, i found the answer, the problem is that event handler attributes are functions, not strings. Mozilla browsers parse the string and create a function object, just like they do when they parse the HTML. IE, expects you to set the attribute to a Function object. the new code is.. /// CODE //// var m = $(''XYZ'').cloneNode(false) m.setAttribute(''id'', ''XYZ_2''); m.value = ''''; m.onblur = function(){ alert(''hola''); }; y6.appendChild(m); //// CODE //// regards On 4/6/06, Whitcraft, Jon <jwhitcraft-1LwPDYEpVrH2eFz/2MeuCQ@public.gmane.org> wrote:> > Make sure you have tbody tags wrapping your rows or it wont work in IE. >-- // // Ing. Francisco J. Calderón S. // fjcalderon-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org // Usuario de GNU/Linux nº 349529 // Maracay, Venezuela // _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs