#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2001
    Posts
    130
    Rep Power
    14

    Javascript routine problems, IE script


    http://development.azorus.com/admin/...ts/mockup.html

    This script should allow the entire DIV to be dragged about when the dragbar is dragged about.

    Echoing values seems to be ok, but the div doesn't actually move. Ideas?

    Statik
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Location
    Back in the real world.
    Posts
    5,966
    Rep Power
    191
    besides the fact that they use a similar syntax, JavaScript has nothing in common with java. Go to the JavaScript forum please. This is java, a "real" programming language.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2001
    Posts
    130
    Rep Power
    14
    Ahh, sorry. I know better. I was in a hurry, and didn't read the heading close enough.

    Statik
  6. #4
  7. No Profile Picture
    Moderator =(8^(|)
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2002
    Location
    Sacramento, CA
    Posts
    1,710
    Rep Power
    14
    This is java, a "real" programming language.
    That offends me . Here's an interesting article about some powerful features built into javascript. http://www.crockford.com/javascript/javascript.html
    -james
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Location
    Back in the real world.
    Posts
    5,966
    Rep Power
    191
    Didnīt mean to offend anyone. Just that you canīt make a "real" program with JavaScript. Also "real" should not be seen as doing "real programming" but in the sense of build a "standalone application". I didnīt mean to say that JavaScript programmers are no "real" programmers which you seem to have read in my post...

    "Make an application that works for everyone".
    I know the problems with making one program work on different platforms. But at least it *IS* possible in Delphi / C (++) / Java, ... - with JavaScript it is NOT. Ever tried to run even *simple* scripts on a Mac?

    From the site you posted:
    The -Script suffix suggests that it is not a real programming language, that a scripting language is less than a programming language. But it is really a matter of specialization. Compared to C, JavaScript trades performance for expressive power and dynamism.
    Disagree. Canīt compare a non-OOP language to JavaScript. And compared to C++ or Java, i canīt leave much good on JS. Furthermore, if you regard statistics, there is probably just as many people that have JavaScript disabled as there is people that donīt have Java installed.

    The main problem i have with JavaScript is less the language itself. Sometimes I even like it too. itīs easy to write and quite powerful. For Client-Side web coding. If you write it for ONE browser.

    Itīs the many different implementations. And that it is sooooo unreliable. Ok, this is not the languageīs fault. If there was a x86 JavaScript compiler, a GUI class library and some other useful stuff, i guess i would gladly use it then and when. (if they also made a nicer way to build classes - but the same goes for php.)

    my conclusion:
    for web-browsers it is the only half-way portable way to make client-side code. this goes for the "JavaScript is just specialized". Do you have any other use for it? And donīt say "Flash"!!!
  10. #6
  11. No Profile Picture
    Moderator =(8^(|)
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2002
    Location
    Sacramento, CA
    Posts
    1,710
    Rep Power
    14
    Ok, just to start, I wasn't *really* offended by what you said . I do think this is a point worth debating though, just so long as we keep this light and impersonal. So here goes:

    I know the problems with making one program work on different platforms. But at least it *IS* possible in Delphi / C (++) / Java
    Sun's jvm, IBM's jvm, gjc, Visual C++, gcc, Rhyno, Window's scripting host, they all seem similar to me. Some run on more platforms than others, but generally it's the compiler/interpreter that's important, not the platform.

    Itīs the many different implementations.
    I think this applies to a lot of languages. Java is actually one of the worst in this regard, especially when it comes to GUI programming.

    ... the last two paragraphs ...
    I think the big stumbling block is that javascript is so often associated with html. It doesn't have to be. Window's has quite a powerful interface exposed to javascript, hence the proliferation of viruses. Sash looks promising, and cross-platform.
    As for GUI object libraries, Mozilla has some good stuff exposed through XUL, and XPCOM is accessable through javascript (I think), giving you access to a lot of hardware level stuff.

    Java has several packages for DOM manipulation and perl is quite good at working with html, but neither is specifically targeted at web design.
    As for browser incomatibilities, all the one's I'm aware of have to do with the way the browser renders the html. DOM support is a version thing, and almost all of the complaints I've seen have to do with positioning.

    I guess my main point here is that you don't have to look at javascript as a web scripting language. Look at it like a language that is commonly used to manipulate web browsers. The language is quite strong, with some very nice features, but browser manufacturers haven't all exposed thier interfaces to javascript in the same way, or with the same quality.
    -james
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Location
    Back in the real world.
    Posts
    5,966
    Rep Power
    191
    ... i must have overseen your smilie ...

    but generally it's the compiler/interpreter that's important, not the platform.
    for interpreters maybe yes, for compilers no. i do c++ in three different environments. just because sometimes this one fits better, sometimes this one. (I got BC++ for free as well as Dev-Cpp, at work i have to use VisualC++ but i refuse to use it privately coz it wonīt ever compile on linux. but i recently installed Dev-Cpp there too.) But the resulting executable program does behave always the same. (if you find your workarounds for "has not been implemented in W9X", "needs SP1 applied", "is buggy on win95", ... but as i said - it IS possible without change of the target platform. JS is not.)
    Iīm doing a lot of low-level and graphics stuff, this is where it sadly does become platform-dependent. I agree on the different JVMs. Java *is* platform dependent dependent on the "virtual" platform)
    iīll have a look at SASH later this day when i am back from work. And for perl - iīve made some "worker"-scripts in perl. but when i started CGI, i quickly changed to PHP. perl is actually exceptionnal for a programming language. there is interpreters as well as compilers. it has *so* many modules that i doubt there is something that canīt be done in perl. There is even a client-side browser implementation by ActiveState that can be used instead of JavaScript. (you see i like perl!)

    but browser manufacturers haven't all exposed thier interfaces to javascript in the same way, or with the same quality
    same goes for the implementation of the core objects... i just hate client-side browser scripting... Recently had to make JS-Regexps work for NN4, IE4+, IE4.5/Mac, IE5/Mac and NN4/Mac. Guess what? NN4 was the easiest one Still, NN4.05 on both OSs segfaulted. I wish i finally could drop support for all the older browsers. But my boss keeps bugging me...

    Also another point: the whole Java family has some real interesting design / implementation problems. One e.g. is:
    design: "any object should be manipulated the same way no matter which type the data iside consists of."
    implementation:
    1+1=2
    "1"+1 = "11" (this is imho not defined by the spec...)
    "1"+"1" = "11" (this is nice - compared to C)
    "1" - "1" = 0 (i would expect "" then, no?).
    seems trivial, but as i am not doing Java / JS that often, i just fell into this pit-trap yesterday again.

    Another one:
    "11" != 11 : should that really make a difference in a scripting language where you IMHO should have to deal with variable types as few as possible?
    (i really like phpīs implementation of string functions!)
    I had a quite big list of stuff like that, but sorry, i canīt find the link anymore.

    Everybody probably has his/her favorite programming language(s). My problem is that for client-side browser stuff, there is nearly no way around JS...
    So i prefer not to use it at all, but do stuff server-side whenever possible. If i want funky looking websites, sound, moving elements etc, i use flash because if i want people to activate JavaScript, i can just as well make them install Flash (from a programers / security analystīs point of view) Flash at last has only ONE implementation where i never had implementation-specific problems.
    Last edited by M.Hirsch; January 29th, 2003 at 02:11 AM.
  14. #8
  15. No Profile Picture
    Moderator =(8^(|)
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2002
    Location
    Sacramento, CA
    Posts
    1,710
    Rep Power
    14
    "1" - "1" = 0 (i would expect "" then, no?).
    Saw that thread .

    Flash at last has only ONE implementation where i never had implementation-specific problems.
    Every time the flash player starts, my computer reboots. I finally deleted the damn thing. Hopefully it's more stable now...

    I'll agree with the ambiguity in working with string values in javascript. I have a feeling some of the problems come from an attempt on the designer's parts to make them easier for non-programmers to work with. If you need to be sure, though, I don't think wrapping a value in Number() is all that hard. You have to do that same sort of thing in Java all the time, too.

    Does nn4 even support javascript 1.5? I can see the frustration with having to make something backword compatible with such an old interpreter. I still have to say that is a fault with interpreter, not the language. Notice that your opinion of C++ isn't adversly affected by the problems with Visual C++. You just use a better compiler.

    I will completely agree that client-side browser scripting is a painful quagmire. I don't think the fault for this lies with javascript not being a "real" programming language, though.
    -james

IMN logo majestic logo threadwatch logo seochat tools logo