| Comments: |
oh, that was a dirty joke.
Aren't standards wonderful? There are so many to choose from!
At least give old Tenne some credit!
Which one ya' looking for? The "AJAX is a waste of time" one, or the "Nobody who counts uses anything but MSIE" one?
The first one doesn't really apply because, well, it's Brad and not some dickhead web designer or tech executive who wants to Change The World and invent The Next Big Thing.
The second was only true pre-spyware and firefox-as-recation-to-spyware.
:P
I remember a JavaScript nightmare similiar to that when trying to add custom lj stuff to the rich text editor.
![[User Picture]](http://l-userpic.livejournal.com/81790144/3171) | From: mart 2005-03-23 08:30 pm (UTC)
| (Link)
|
I don't really know if this could apply in the situation you're describing, but remember that JavaScript's concept of scope is based on a list of objects, and there are a lot of places where new scope objects get implicitly added to the list. One good example of this is with event handlers, where the object that triggered the event or the event itself become the top of the scope list. This behavior differs wildly between browsers, as you're coming to expect.
Also, some browsers pass the event that was raised as the first parameter to an event handler, while others (such as IE) don't pass anything to the event handler and require you to get it out of some variable in the current scope. This particular one caught me out when I was writing that shitty color picker.
The main reason I brought all this up was because you said you were getting an event object in an unexpected place. This is just a couple of event-related gotchas that probably don't have anything to do with it. ;) If you're going to write compatability wrappers, make sure to keep the wrapper thin; all of the wrappers I've seen before have ended up trying to do too much and have been several times larger than the script I was writing, so I just ditched them and handled the few applicable parts myself, inline.
![[User Picture]](http://l-userpic.livejournal.com/54541970/2) | From: brad 2005-03-23 10:01 pm (UTC)
| (Link)
|
It's the scope chain that was the issue.
I worked around it, but I'm reading my "JavaScript: The Definitive Guide; 4th edition" again so I fully understand what happened.
Dude. "that shitty color picker" is pretty cool. =]
![[User Picture]](http://l-userpic.livejournal.com/34613140/604) | From: nick 2005-03-23 08:43 pm (UTC)
I'm pretty smart, but... | (Link)
|
Anytime I hear that I can't help but expect the next thing to come out of that person's mouth to be absolutley retarted (I'm mean obviously not in this case since I have no idea what the hell you are talking about). Expressions like that just makes me think middle aged woman talking to a mechanic or something... "I'm a relatively intelligent person, but I just don't understand why you want me to change my oil if I still have plenty left"
![[User Picture]](http://l-userpic.livejournal.com/34474992/3171) | From: mart 2005-03-23 09:11 pm (UTC)
Re: I'm pretty smart, but... | (Link)
|
A similar phrase is “I don't mean to be rude, but…”.
I don't know how people think that phrase can make them immune to causing offense.
![[User Picture]](http://l-userpic.livejournal.com/9624370/1571) | From: evan 2005-03-23 09:38 pm (UTC)
Re: I'm pretty smart, but... | (Link)
|
No offense, but...
![[User Picture]](http://l-userpic.livejournal.com/69211497/3155) | From: casey 2005-03-23 09:48 pm (UTC)
Re: I'm pretty smart, but... | (Link)
|
I'm not sure where my pants are, but regardless...
From: sherm 2005-03-23 09:51 pm (UTC)
Re: I'm pretty smart, but... | (Link)
|
With all due respect...
![[User Picture]](http://l-userpic.livejournal.com/88158703/6491) | From: dakus 2005-03-23 10:29 pm (UTC)
Re: I'm pretty smart, but... | (Link)
|
Trust me...
![[User Picture]](http://l-userpic.livejournal.com/23414542/1471447) | From: koehlerk 2005-03-23 10:39 pm (UTC)
Re: I'm pretty smart, but... | (Link)
|
"don't mean to get off topic but..."
You're a great friend but...
![[User Picture]](http://l-userpic.livejournal.com/3114/6070) | From: meowpurrr 2005-03-23 10:28 pm (UTC)
Re: I'm pretty smart, but... | (Link)
|
because an intention to cause insult is half of the crime. you're only responsible for someone being offended if you're offending them deliberately. of course, then there's sarcastic use of those phrases, which negates them again.. :>
It's better than it used to be. I was big into JS/DHTML stuff back in the day, trying to do crazy shit in Netscape 4. I eventually got sick of writing more code to handle browser versions and settled on Flash, which I still think is better for those types of applications. I won't go back to JS until there are tools and libraries that handle those incompatibilities for me. (That said, I assume you're familiar with Venkman.)
![[User Picture]](http://l-userpic.livejournal.com/14667569/3092994) | From: snej 2005-03-23 09:22 pm (UTC)
| (Link)
|
If you send me an example that reproduces the bug, I can (a) see if it still happens in the current soon-to-be-released version of Safari, and (b) file a bug report if necessary.
![[User Picture]](http://l-userpic.livejournal.com/54541970/2) | From: brad 2005-03-23 10:02 pm (UTC)
| (Link)
|
Thanks! I wrote a minimal test case but sure enough, it worked. So I'm still looking into it. I worked around it for now, but I'm sure it's just something I don't understand.
Apropos... "In Google we refer to the approach as alternatively The Pain or The Excitement depending on whether or not you're working on a Safari bug."
-Chris Wetherell on the name Ajax via the dojo toolkit mailing list.
Where I work we are lucky in that we don't even support Safari. Maybe 2.0 and Tiger will help.
Hey, you should be thankful that MS was even that good at ripping off Netscape's technology.
If they'd REALLY had their way, you'd be writing a VBScript version of everything for MSIE. ;)
konq! its alright, its just really secure, i wouldnt so much call them bugs. but why not just use firefox.
![[User Picture]](http://l-userpic.livejournal.com/54541970/2) | From: brad 2005-03-23 10:03 pm (UTC)
| (Link)
|
Uh, I do. But my users use everything. And Konq was just to approximate Safari, which I'm also testing in.
thats true, what users are you talk about, are you still working with lj or do you have a new project
Just for the record, the fact that I had to launch Safari just to set Firefox as my default browser under Mac OS X means that I am never, ever using that steaming pile of shit.
From: cjensen 2005-03-23 11:47 pm (UTC)
I see a need | (Link)
|
Maybe you should create a meta-language that compiles into JavaScript portably. So the language would have a clear and single definition of how everything works, and then the compiler would arrange to have it work the same on each JavaScript implementation.
Or solve world hunger. Shouldn't be much harder.
I _HATE_ doing js against Safari. Ugh.
Yep. My solution is usually just to avoid events entirely. :-) Events suck, cross-browser.
Of course, I suppose that's not possible with jsdraw.
-Max | |