Slashdot Mirror


Mozilla Extending Javascript?

Nomad128 writes "Mozilla's Deer Park 1 Alpha RC appears to have extended the Javascript spec for the first time in quite some time. New features include Array object methods "every" (logical AND), "some" (logical OR), "map" (function mapping), and "forEach" (iteration). They also appear to have added native XML support. Will this speed up the development of AJAX applications and give Moz a leg-up over IE7?"

14 of 286 comments (clear)

  1. Moz Extensions by multipartmixed · · Score: 4, Interesting

    This isn't a case of 'embrace and extend', microsoft-style -- this is a case of extra functionality needed to write extensions. Any web developer using these for public apps is clearly a butt-head.

    --

    Do daemons dream of electric sleep()?
  2. Article badly termed? by Anonymous Coward · · Score: 5, Interesting

    They're not extending javascript from what I can see. It looks like they're implementing some features that weren't implemented before.

  3. Make way for the "butt-heads" by Short+Circuit · · Score: 2, Interesting

    I think we're going to see some of the same things added to IE7's Javascript engine, but implemented differently.

    Which means more special-case code for web developers.

  4. Re:Javascript Extensions by vidarlo · · Score: 2, Interesting
    I don't think the Javascript extensions will be used very much. Personally, I'm coding Javascript that will work in most browsers, which means I have to specifically exclude this new Javascript unless IE et al also implement it (and even then, older browsers still won't like it). Not to be anti-Mozilla, but this does sound a bit like embrace and extend to me. (Yes, I know it's open source and others can read the specs.)

    This mainly depends whatever any other browser picks it up. Compare this with last story, about a new browser war. Clearly the firefox developers have to keep a very sharp focus at extending and develeoping mozilla/firefox to keep up against IE7. Only thing I hope is that it won't lead to the spagethi-code-era once again...

    One thing I'm wondering is if there is a single standard for javascript. Wikipedia has a entry about javascript, mentioning ECMA-script. How does those addons fit into the standards?

  5. About standard compilance by Anonymous Coward · · Score: 3, Interesting

    Deviance from standards (at least in a web environement) is bad because the code that works in one browser won't work in another browser.

    But that's not necessarly a bad think in my opinion. If one browser starts extending and empowering web developper in many and novel ways, this browser may well raise the bar for all browsers and shit expectation (if developper find, in mass, that the features are worthwhile, cool, useful, etc...).

    However, deviance from standards are bad if they are unsignificant, unrevolutionary, unimportant, just a little improvement (not to confound with many little improvments that combined can make a big difference).

    So if you're going to deviate from standard, do it big time!

  6. The best part.. by Eloquence · · Score: 4, Interesting
    ..is the super fast back/forward cache (add a new positive Integer value browser.sessionhistory.max_viewers in about:config to enable it). My impression is that it's even faster than Opera's, though there seem to be some conditions under which a slower reload is used. In any case, this is an absolute killer feature, and I hope they manage to get it ready to be enabled by default for 1.1.

    The other killer feature is, of course, SVG support by default -- unlike the crappy Adobe plugin, fast and reliable SVG support. A lot of stuff that is currently done in Flash can be done in SVG without any dependency on non-free software (or unstable, experimental open source players). Personally, I'm most excited about its possible uses in Wikipedia. Unlike a bitmap file, an SVG can be collaboratively edited: translate text, fix mistakes, and so on. Beyond illustrations, SVG is also useful for zoomable timelines, of which Wikipedia has quite a few, and which are already exported as SVG.

    I think that Firefox support for SVG could be a major reason to switch from other browsers if we come up with cool SVG-based applications (not that we really need more reasons to switch!). One thing that would be neat is the ability to generally pan and zoom an SVG file even if there are no JavaScript controls for that, I haven't seen that functionality. Perhaps a bookmarklet or GreaseMonkey script could do the trick.

    I can't wait for the final version, but I'd be happy to wait 3 months longer if that's how long it takes to get it ready for primetime. One thing is for sure: Firefox 1.1 will kick butt.

  7. Re:What? by Anonymous Coward · · Score: 2, Interesting

    Right now I'm doing some Web development work within my company where I can control all of the specs. I KNOW what computers, what browsers, &c. will be using the application and if these extensions were to prove useful, I'd just use them. The plan all along was to standardize on Mozilla for this, so that's not really a problem.

    Would I use this for a site that outsiders would ever access? No.

  8. Re:Funny... I thought ECMAScript was an open stand by slavemowgli · · Score: 3, Interesting

    Most, if not all, Mozilla extensions use Javascript, so that's most likely what these changes are aimed at. I don't think you're supposed to use them on public webpages; if the Mozilla guys really care, then they'll also make sure that these extensions won't work in that case.

    --
    quidquid latine dictum sit altum videtur.
  9. Re:Javascript Extensions by Anonymous Coward · · Score: 0, Interesting

    In other words, they shouldn't be used anywhere that everyone isn't using the latest/greatest Mozilla, or , for all practical intents and purposes, anyfreakingwhere. So they're how useful, exactly?

  10. Native XML is a very neat feature by MarkEst1973 · · Score: 3, Interesting
    Using Rhino http://www.mozilla.org/rhino -- which already has the E4X functionality in the runtime -- you can stuff like this (using an html document as my sample xml):

    var html = <hmtl/>
    html.head.title = "my title";

    print(html);

    This prints as:

    <html>
    <head>
    <title>my title<title>
    <head>
    <html>

    Although this is a contrived example, I find the ability to access XML as native objects using dot-notation to be very convenient and useful.

  11. Re:Javascript Extensions by DrSkwid · · Score: 2, Interesting

    if you did spend all day working in ajavscript, then you'd know that you can create a standard library that will work cross browser

    one can replace any functions that are missing or don't work how you like them.

    I remember back in the days before getElementById in I.E. I added my own so that I could write my code assuming it was present :

    document.getElementById = function (id) { ..... }

    as you go along you find out what works what doesn't.

    It's not *that* different from developing wxWindows or gtk to work on windows & X : find the glitches, work round 'em

    --
    There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
  12. Restrict extensions to extensions by Doros · · Score: 2, Interesting

    I wish that Mozilla would only allow these language extensions (such as the -moz CSS properties) to work in Mozilla extensions. These are obviously useful language tools, but the web is divided enough as it is. This way, the browser extension development scene could serve as a test bed to language extensions. The new syntax and functions don't seem to have been widely tested. If somebody finds a problem with the initial release, will the next version of Mozilla have a new syntax? These extensions should be proposed to a standards organization. People need to stop dumping more undocumented, unstandardized stuff into the web. The way things are going, web developers will soon have to target 4 versions of Mozilla, 3 versions of Internet Explorer, Konqueror, 2 versions of Safari, and Opera.

  13. Mozilla and Cairo by krappie · · Score: 2, Interesting

    I think what deserves more attention is the badass development of cairo into Mozilla.

    Check out the blog of the main developer thats doing this development. Hes got some excellent demo screenshots.
    http://weblogs.mozillazine.org/roc/

  14. Standards? by shancock · · Score: 2, Interesting

    I guess I don't get it. If one is only developing for a private intranet and will not be accessed by any other browsers except Mozilla, then this is basically creating propriatary software where anything goes anyway. Otherwise it seems to be similar to the old Netscape/MS IE extensions war for browsers that caused so many problems years ago ( and still is causing problems).

    What happens if the company wants to scale up later to allow clients to view or to incorporate this great new stuff on the/a public website. It just doesn't make much sense to me in the long run.

    Am I missing something important here?