D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] IE8 borked?

 

On 08/06/11 21:41, Philip Hudson wrote:
On 8 Jun, 2011, at 9:19 pm, Joe Buckle wrote:

On Wed, 2011-06-08 at 11:45 +0100, tom wrote:
Just been writing a bit of javascript and it looks like IE8 is screwed:

var elem=document.createElement("input");
elem.attribute.type="text";

seems to work on most browsers but not IE8

cant prove for certain ie8 is 'wrong' but it looks like it..
Tom te tom te tom

What is it you're trying to do by doing this? Are you trying to add text
fields on demand on the client side with a button onclick event? Or just
trying to produce elements dynamically using javascript? ]

elem.attribute.type="text";

is more likely to read something like

documnent.getAttribute("type", "text");

Again this depends one what you're trying to do.


Without knowing anything about what you're trying to achieve, it's poor ux to have controls/widgets appear and disappear. Rather have them visible but disabled, and then dynamically enable them according to program logic, or else use some kind of workflow/wizard/tabs. Or, as so often, throw it away, start again, and use your second design -- it's almost always loads better.

--
Phil Hudson                  http://hudson-it.no-ip.biz
@UWascalWabbit                 PGP/GnuPG ID: 0x887DCA63


I was trying to do what the dom is (I believe) meant to do.
On most browsers elem.attribute.type='text' == elem.attribute["type"]=text == elem.type="text" but not IE8 apparently.

As far as I can tell IE8 doesn't see 'type' as a valid attribute for input - which I beleive is wrong. I have got a work around to do what I wanted to (elem.type="text" IIRC) but proving IE8 is not dom compliant would be fun but I'm having trouble locating what might be the standard.
Tom te tom te tom

--
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq