|
This thread is locked; no one can reply to it. |
1
2
|
JavaScript: Enough BS |
Billybob
Member #3,136
January 2003
|
I'm wasting gobs of time struggling with JavaScript. Is there anyway to have JavaScript tell me all the attributes of a given object? In particular, I need to know what stuff the event object has, because I seriously can't figure out what it does and doesn't have in Firefox. Or a decent online documenation of what these objects have and don't have under various browsers. w3schools lists some things, but it sucks when it comes to telling me what each browser does and doesn't have.
|
Marcello
Member #1,860
January 2002
|
for (var i in o) { println("o."+i+"="+o<i>); } But I recommend using venkman's debugger thing, it shows a whole tree and lets you set breakpoints and whatnot. Marcello |
ReyBrujo
Moderator
January 2001
|
Indeed. You can install it as a extension for Firefox. -- |
Matthew Leverton
Supreme Loser
January 1999
|
Billybob
Member #3,136
January 2003
|
Thanks! Another question while we're here. JavaScript is being its same old self...which is being a pain in the butt. var html = "<div style='position: absolute; width: 0px; height: 0px; border: 1px solid black;' id='div-id-" + div_id + "></div>"; e.src.innerHTML = html + e.src.innerHTML; Doesn't work right. For some really odd reason JS has decided to convert SOME, but not all, of html's string into html entities. Yes, only some. In particular everything after div-id= gets htmlentities run on it, up until the end of the html string. Everything that was originally in e.src.innerHTML is fine...well except for the fact that it's all corrupted now that there's broken HTML at the top of it. e.src is: if(event.target) e.src = target; Part of a left mouse down event. In this case it's pointing at document.body. Any ideas what's up?
|
Marco Radaelli
Member #3,028
December 2002
|
Aren't you missing a ' somewhere after div-id-?
|
Billybob
Member #3,136
January 2003
|
That is a DARN good point. Thanks!
|
Marco Radaelli
Member #3,028
December 2002
|
Hehe, these are the kind of things which make programming fun
|
Ceagon Xylas
Member #5,495
February 2005
|
Javascript is BS, dude. |
Marcello
Member #1,860
January 2002
|
Then you clearly know nothing about the language. What's so bad about it? Disregarding crap implementations of it, of course. |
nonnus29
Member #2,606
August 2002
|
Quote:
Javascript is BS, dude. Don't confuse javascript with DOM weirdness either. Javascript (or the language defined by ECMA-262) is actually a really slick little language when you consider it on it's own. |
CGamesPlay
Member #2,559
July 2002
|
Another important technique: -- Ryan Patterson - <http://cgamesplay.com/> |
Ceagon Xylas
Member #5,495
February 2005
|
Well I guess now I've met 3. ^.^ |
CGamesPlay
Member #2,559
July 2002
|
You're confusing "people who love JS" with "people who posted since your last reply"... -- Ryan Patterson - <http://cgamesplay.com/> |
Ceagon Xylas
Member #5,495
February 2005
|
Haha well they defended it pretty strongly... Specially Marcello. |
ReyBrujo
Moderator
January 2001
|
JS is good enough for what it needs to do. [Now, let's add fuel for the flame war] I believe it is not as "loved" because there aren't many good IDEs. [A bit more] And everyone knows nowadays programmers without an IDE are end users. [That last one was enough I believe ] -- |
kentl
Member #2,905
November 2002
|
The biggest "flaw" of JavaScript IMHO is that Microsoft went the JScript route and thus made cross browser compatibility harder. Apart from that, language wars are always silly per definition. Use the right tool for the job. |
Billybob
Member #3,136
January 2003
|
Quote: I believe it is not as "loved" because there aren't many good IDEs I disagree. I love PHP, and don't use any ides for it other than SciTE, which I use for every other language. An IDE makes a language easier to use by providing you with some helpful tools like parameter info and such, but it's not going to help a broken language. Quote: Apart from that, language wars are always silly per definition. Use the right tool for the job. Except for the fact that JavaScript is the only tool for the job.
|
ReyBrujo
Moderator
January 2001
|
You are forgetting vbscript -- |
Marcello
Member #1,860
January 2002
|
How can someone love PHP? What's so great about it? The syntax is ugly, the library is convoluted and unorganized, the class system is crap (maybe php5 is ok, but geez!). I'm slowly making the switch from PHP to JavaScript, and every second I am amazed at how much easier and faster it is to develop in. Marcello |
Thomas Fjellstrom
Member #476
June 2000
|
I'll be using ECMAScript in my GUI applications.. TrollTech has a nice library called QSA (Qt Script for Applications) which is an implementation of ECMAScript thats tied heavily into Qt, Anything you can do in C++ with Qt, you can do in QSA, and then some. -- |
kentl
Member #2,905
November 2002
|
Quote: Except for the fact that JavaScript is the only tool for the job. Did I say it wasn't? (Answer: No) |
BAF
Member #2,981
December 2002
|
How can you use JavaScript in place of PHP? Unless you're using ASP or something. |
Marcello
Member #1,860
January 2002
|
Like this. |
kentl
Member #2,905
November 2002
|
I would like it to be possible to create a bitmap using JavaScript and set pixels within it, which AFAIK isn't yet possible. |
|
1
2
|