vegUI.org home of the javascript based window manager and AJAX framework

This is madness

written by vegu on 19 Aug, 2007 10:17:07
I am such a slacker. Work has been going very very slow the past few weeks and i apologize for the lack of updates. The good news is my other project is about to be ready to go live. Once that is done i will add the new module(s) (? maybe plural, WHO KNOWS) for the vegUISiteKit that i have been working on, promise :)

For the time being i have disabled links in comments, since the spam problem has risen to ridiculous levels. While we're at it, a big ,,i,, to the spammers. I feel a little better now.

Anyways, i have been notified that apparently vegUI and prototype are not compatible, meaning your browser will explode into thousand little pieces should you attempt to use both of them at the same time. Fortunately - as i dont use prototype - the person that encountered the problem also had an solution, and since i know that prototype is a very popular library i figured it'd be good to spread the word :)


The problem is that since Prototype adds a bunch of methods to the Array class,
if you iterate through an array with "for x in arr {...}" you end up iterating through a
bunch of functions instead of just the indexes.

In case you get anyone asking about this, the javascript error in
firefox said "A.Element has no properties", pointing to this code in
vegui.std.js (in move()):

for(a in this.Attached) {
A = this.Attached[a];
if(!A.Element.Base)
continue;

in this case, A is actually a Prototype Array function like "each",
meaning A.Element is null, which crashes it.

You COULD iterate through arrays C-style and it'd probably fix it, but I found something easier.
Someone wrote a little chunk of code called Prototypify

(http://ajaxian.com/archives/prototypify-running-prototype-code-with-legacy-code)

that gets rid of those Prototype extensions unless you explicitly need them,
meaning it makes VegUI work.


Thanks Mat!

Related Posts

  • No related posts



Your Comment

name:*
email-address:

Are you human?



Comments

No comments yet.