• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Why does Javascript suck so much?

GoingUp

Lifer
Granted I was never that good at java, but javascript drives me nuts especially b/c you dont declare what kinds of data types are getting passed in methods.

We are trying to write some stuff for a mapping website and I cant for the life of me figure out how to pass one variable from one method to another.

We need to pass the variable "region" but I can't figure out how to properly pass it. We declaired it as global, but as soon as the HTML redirects, the javascript stops running and the variable disappears....
 
Maybe you'll get better results when you use a more robust Server side object orientated language like ASP or PHP.

"but as soon as the HTML redirects", what did you mean by this?
 
You do of course realize that JavaScript is client-side, and thus its values are not persisted across pages unless passed in the querystring? You can do that using location.href or window.open, but as Regs said, a server-side language might be more suitable.
 
Originally posted by: Descartes
You do of course realize that JavaScript is client-side, and thus its values are not persisted across pages unless passed in the querystring? You can do that using location.href or window.open, but as Regs said, a server-side language might be more suitable.

Well I dont want to get roped into rewriting the whole site....

The HTML redirect is different java scripts calling about 10 different html pages that validate everything from layout to browser version and other stuff. I didnt design any of this, im just trying to help them fix their problems...
 
I always had a really hard time with javascript for some reason. The fact that it wasn't a real programming language always bothered me since what may seem as intuitive really isn't. I stilck to PHP though and be happy - its less annoying.
 
Javascript is not meant to create Web applications out of ... it is primarily for creating a nice user interface between trips to the server. For this purpose...combined with DHTML...javascript does a very nice job. I rarely find places where we are limited by this.
 
Yeah, these weak typed languages drive me crazy.

I was raised on C++/Java which are strongly typed, and then started doing PHP and Javascript and the weak-typing drives me crazy.

Oh well, what can ya do.

-Ankur
 
Back
Top