3 ms·
> How do I manipulate the DOM in java? That's kind of Applet's 101: http://docs.oracle.com/javase/tutorial/deployment/applet/manipulatingDOMFromApplet.html htt
by cbsmith 13y ago
> How do I manipulate the DOM in java?
That's kind of Applet's 101: http://docs.oracle.com/javase/tutorial/deployment/applet/manipulatingDOMFromApplet.html http://docs.oracle.com/javase/tutorial/deployment/applet/man...
Flash has similar (arguably much better) API's for this as well. There are graveyards filled with other attempts.
> Javascript absolutely is the only option, and people have no choice.
Being the most broadly supported and most integrated solution doesn't mean developers have no choices. It just means they JavaScript might be their best choice. On almost any platform there are going to be certain programming languages that are more integrated and better supported.
> That is why people invest so much time in writing LANGUAGE_X to javascript compilers, so they can write code in a less terrible language even though it has to be deployed as javascript.
And there you have it. JavaScript wins by virtue of being a better deployment platform in the browser space. At one time Java used to enjoy an even broader advantage. Acrobat, Flash, VBA, Bourne Shell, MSI, Unix DBM, SQL, sendmail, PHP, MySQL, Windows, Linux, C, POSIX, PostScript, XWindows, etc. have all ridden these kinds of waves. Some are more successful than others, and certainly the web browser is probably the most ubiquitously deployed runtime environment ever, but really, if anything this is normal and the broad diversity is not.
It's not unfair or unusual, so much as inevitable.
- asdasf 13y ago>That's kind of Applet's 101 So, write javascript to trigger a java applet that changes the dom is a reasonable alternative to writing javascript to change the dom? >Being the most broadly supported and most integrated solution doesn't mean developers have no choices Yes, it literally does. When presented with one option, you have no choice. >And there you have it. JavaScript wins by virtue of being a better deployment platform in the browser space Are you serious? >It's not unfair or unusual Nobody said it was. Just that javascript sucks and we're stuck with it against our will.
- cbsmith 13y ago> So, write javascript to trigger a java applet that changes the dom is a reasonable alternative to writing javascript to change the dom? Depends on what you mean. These days people often have Applets disabled. But if you have an Applet with the access to do so, you can manipulate the DOM as much from it as you could from JavaScript. > Yes, it literally does. When presented with one option, you have no choice. There are lots of options, its just one is better than the others. >> And there you have it. JavaScript wins by virtue of being a better deployment platform in the browser space > Are you serious? Absolutely. People made a go of it with Applets. Once they realized they could get the job done with JavaScript, they dropped Applets like a hot potato, to the point where Applets are being dumped. Most other in browser programming environments are platforms in their own right that talk to browser platform. JavaScript's platform is the browser, and that turns out to make a big difference. > Just that javascript sucks and we're stuck with it against our will. Depends on you who define as "us". You're going to want to get familiar with "worse is better": http://www.jwz.org/doc/worse-is-better.html http://www.jwz.org/doc/worse-is-better.html
- cbsmith 13y ago> So, write javascript to trigger a java applet that changes the dom is a reasonable alternative to writing javascript to change the dom? Actually, I missed one important aspect of what you were saying: "So, write javascript to trigger a java applet that changes..." No, there is no requirement for any JavaScript at all. You just use an applet tag (well, these days you use the object tag, but you get the idea...).
- asdasf 13y ago>No, there is no requirement for any JavaScript at all. Yes there is. How else is the applet going to respond to what the user is doing to html elements on the page?
- cbsmith 13y agoa) You said DOM manipulation b) http://docs.oracle.com/javase/7/docs/jre/api/plugin/dom/org/w3c/dom/events/package-summary.html http://docs.oracle.com/javase/7/docs/jre/api/plugin/dom/org/... Look. I don't have time to teach you how to code. Let's just assume I know what I'm talking about more than you do.
- asdasf 13y agoYou really think pulling the "you are too dumb to understand my bullshit" card is effective? Javascript is used to make changes to the dom in response to the user doing things. User clicks button, stuff changes. Have you ever actually tried doing that with a java applet? Have you noticed how 75% of the api doesn't actually work in any major browser?
- cbsmith 13y ago...and there you go again about lack of support. Have you noticed that Java Applet's just generally aren't supported anymore? We tried it (and yes, all the event handling worked). No one used it and it exacerbated security problems.