Prototype: IE Issues?

0 views
Skip to first unread message

Kyle Brady

unread,
Nov 29, 2007, 2:22:18 AM11/29/07
to Ruby on Rails: Spinoffs
For some reason, after the most recent upgrade to the latest prototype
version, some of my scripts stopped working in IE. They continue to
work in FF, but IE shows a "script error".

Specifically, I'm having problems with:
$('the_item').innerHTML = 'whatever';

Any help/insight is appreciated.

Thanks

--Kyle

Roland

unread,
Nov 29, 2007, 2:55:36 AM11/29/07
to Ruby on Rails: Spinoffs
$('item').update('whatever');

Kyle Brady

unread,
Nov 29, 2007, 2:57:02 AM11/29/07
to Ruby on Rails: Spinoffs
Ok, I'll have to give it a try tomorrow... but why would .innerHTML
stop working altogether? Especially in IE, when Microsoft supposedly
developed the innerHTML functionality back in the day?

Thanks for the help
--Kyle

Thomas Fuchs

unread,
Nov 29, 2007, 3:24:55 AM11/29/07
to rubyonrail...@googlegroups.com
Please give a full example, preferably at an online URL where this
happens. You can also try using Microsoft Script Debugger to isolate
the line of code where this happens.

The latest version of Prototype sure works fine here on IE,
and .innerHTML isn't even part of Prototype -- in this case i assume
that $('the_item') returns nothing. To debug it, a full HTML page is
required.

Best,
Thomas

Bertilo Wennergren

unread,
Nov 29, 2007, 6:59:02 AM11/29/07
to rubyonrail...@googlegroups.com
Kyle Brady wrote:

> Specifically, I'm having problems with:
> $('the_item').innerHTML = 'whatever';

MSIE (some version...) has been known to have problems
with ids using the "_" character - sometimes in very
unusual circumstances that are almost impossible to
pinpoint.

Try it with "theitem" instead (of course renaming
the actual element as well).

--
Bertilo Wennergren <http://bertilow.com>

Thomas Fuchs

unread,
Nov 29, 2007, 8:23:50 AM11/29/07
to rubyonrail...@googlegroups.com
I never had any issues with that. Can you give examples...? Sounds FUD-
ish to me... :?

Best,
Thomas

Bertilo Wennergren

unread,
Nov 29, 2007, 9:22:12 AM11/29/07
to rubyonrail...@googlegroups.com
Thomas Fuchs wrote:

> I never had any issues with that. Can you give examples...? Sounds FUD-
> ish to me... :?

It happened to me a couple of times, but it was very long ago. A
mysterious bug in MSIE just disappeared when I changed to an id without
an underscore. It really should not matter, and most of the time
it doesn't. But once in a blue moon it does - for some unclear
reason. It's probably very very rare.

Kyle Brady

unread,
Nov 29, 2007, 11:26:51 PM11/29/07
to Ruby on Rails: Spinoffs
The underscore was just an arbitrary example. But, I've changed
the .innerHTML usage to .update('whatever'), and I'm still having
problems in IE with it (not FF)... returns a "script error".

Here's a real example of the code I'm using:

$('registerMessage').update('<p><strong>Update Failed. Please Try
Again.</strong></p>');

Pretty standard, right? In other instances, I'm doing something like:

$('registerMessage').update(val);

Where "val" is a variable containing stuff.

For a real example, you can visit http://consumer.myshoutoutloud.com
[will require user registration], and try out the "myDATA" page. This
live version is using the .update method rather than the .innerHTML
method, since neither work anyway.

Thanks
--Kyle

Kyle Brady

unread,
Nov 29, 2007, 11:38:30 PM11/29/07
to Ruby on Rails: Spinoffs
Addendum: now things just aren't working in GENERAL after moving to
the .update method.

Great.

--Kyle

Kyle Brady

unread,
Nov 30, 2007, 12:03:00 AM11/30/07
to Ruby on Rails: Spinoffs
Solution:

So what happened was that my scripts (and IE) stopped liking
action="<? echo $PHP_SELF; ?>", and so I replaced it with actual
URLs. I'm not sure if that fixed it, or it was some other little
tweaks I made, but overall it works.

I just have to work out a few minor things, but it's working in IE.

Thanks for the help.

--Kyle
Reply all
Reply to author
Forward
0 new messages