[Proto-Scripty] Re: hide() not working for me on IE
does $(id).select('span [class~=uploadingmessage]')[0] return an(extended)/ element correctly ? - Original Message - From: "Lavanya Shastri" To: "Prototype & script.aculo.us" Sent: Wednesday, July 01, 2009 8:11 AM Subject: [Proto-Scripty] Re: hide() not working for me on IE > > It works if you do this: > > function hideElement(id){ > $(id).style.display='none'; > } > > > function fileUploaded(id, filename) { > var uploadingMessage = $(id).select('span > [class~=uploadingmessage]')[0] >> >> ; >>uploadingMessage.hide(); >> >>var a = new Element('a', { >>''href' : "javascript:hideElement('" + id + >> "');" >> false;" >>}).update("(alpha)"); >> >>} > > > On Mon, Jun 29, 2009 at 12:28 PM, ls86 wrote: >> >> Hi, >> >> I am new to Prototype and here is a code snippet that works perfectly >> on firefox but doesnt work on IE for some reason.If anyone knows whats >> wrong here or can help me out in any way I'd really appreciate it. >> >>function fileUploaded(id, filename) { >>var uploadingMessage = $(id).select('span >> [class~=uploadingmessage]')[0]; >>uploadingMessage.hide(); >> >>var a = new Element('a', { >>'href' : "#alpha", >>onclick : "$('" + id + "').hide();return >> false;" >>}).update("(alpha)"); >> >>} >> >> Thanks, >> LS > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: hide() not working for me on IE
It works if you do this: function hideElement(id){ $(id).style.display='none'; } function fileUploaded(id, filename) { var uploadingMessage = $(id).select('span [class~=uploadingmessage]')[0] > > ; >uploadingMessage.hide(); > >var a = new Element('a', { >''href' : "javascript:hideElement('" + id + "');" > false;" >}).update("(alpha)"); > >} On Mon, Jun 29, 2009 at 12:28 PM, ls86 wrote: > > Hi, > > I am new to Prototype and here is a code snippet that works perfectly > on firefox but doesnt work on IE for some reason.If anyone knows whats > wrong here or can help me out in any way I'd really appreciate it. > >function fileUploaded(id, filename) { >var uploadingMessage = $(id).select('span > [class~=uploadingmessage]')[0]; >uploadingMessage.hide(); > >var a = new Element('a', { >'href' : "#alpha", >onclick : "$('" + id + "').hide();return > false;" >}).update("(alpha)"); > >} > > Thanks, > LS --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: hide() not working for me on IE
Hi, Which *part* doesn't work on IE? Hiding the uploading message, hiding the whole thing when you click the link, or...? A couple of things jumped out that may or may not be relevant: 1. I don't see that you're adding the link anywhere. You create it, but don't add it to any element anywhere. 2. onclick handlers are quite old-fashioned. I'd suggest using Element#observe[1] instead. Something like this: function fileUploaded(id, filename) { var uploadingMessage = $(id).select('span [class~=uploadingmessage]')[0]; uploadingMessage.hide(); var a = new Element('a', { 'href' : "#alpha" }).update("(alpha)"); a.observe('click', function(event) { $(id).hide(); event.stop(); }); } Again, though, you'll need to add the missing link (no pun) somewhere, the above still doesn't have that (since I don't know where you want to add it). [1] http://prototypejs.org/api/element/observe HTH, -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Jun 29, 7:58 am, ls86 wrote: > Hi, > > I am new to Prototype and here is a code snippet that works perfectly > on firefox but doesnt work on IE for some reason.If anyone knows whats > wrong here or can help me out in any way I'd really appreciate it. > > function fileUploaded(id, filename) { > var uploadingMessage = $(id).select('span > [class~=uploadingmessage]')[0]; > uploadingMessage.hide(); > > var a = new Element('a', { > 'href' : "#alpha", > onclick : "$('" + id + "').hide();return > false;" > }).update("(alpha)"); > > } > > Thanks, > LS --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---