On 10/23/06, Jorge Godoy <[EMAIL PROTECTED]> wrote: > > "Thomas Hervé" <[EMAIL PROTECTED]> writes: > > > Jorge Godoy wrote: > > > >> It was a valid URL and the code was perfectly fine. It worked when using > >> only > >> HTTP (development server) but not on HTTPS (production server). I changed > >> the > >> HTML element to an input field and the code ran perfectly. > >> > >> As a solution to this problem I: > >> > >> - changed from ".innerHTML" to ".value" (because <label> has no > >> ".value" I > >> had to use ".innerHTML") > > > > On label you have to define its text content. > > It doesn't work. I have it in the test case below. > > >> - changed from <label> to <input type="text" disabled="1" > >> class="borderless" /> > >> (my input fields have a 1px border by default, so I had to override > >> that > >> with a special class) > >> > >> These were the only changes to make the code work. So, at least Firefox > >> has a > >> restriction on changing labels when on a HTTPS page. > > > > You haven't convinced me :). Try to find a small reproductible example; > > if it's true, you should report this to mozilla. > > > > Here it is: > > ================================================================================ > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" > "http://www.w3.org/TR/html4/strict.dtd"> > <html> > <head> > <title>Label Change Test</title> > <script type='text/javascript' src='MochiKit.js'></script> > <script type='text/javascript'> > function change_label(evt) { > $('changeme').text = 'Changed!'; > $('changemetoo').innerHTML = 'Changed!'; > $('changemethree').value = 'Changed!'; > } > </script> > </head> > <body> > <form action="#"> > <label id='changeme'>Change Me!</label> > <label id='changemetoo'>Change Me Too!</label> > <label id='changemethree'>Change Me As Well!</label> > <input id='change_button' type='submit' value='Change text' /> > </form> > <script type='text/javascript'> > connect('change_button', 'onclick', change_label); > </script> > </body> > </html> > ================================================================================ > > The text changed here on a secure and non-secure website. I'll compare it > with my more complex use case. But I had to use innerHTML and not text to > change the contents of the label.
I don't think the "text" property is standard here. I'm surprised it works anywhere. Use innerHTML or replaceChildNodes(). -bob --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "MochiKit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/mochikit -~----------~----~----~----~------~----~------~--~---
