views:

70

answers:

2

Possible Duplicate:
Alternatives to JavaScript

Hi there,

As there are many programming languages, and you have options, that which ever language you want to work on, like you if you use C# then you have option that you can use VB.NET or C++ etc further you we have Java which can replace C# or C# that can replace Java. So we have options.

My question is that as Javascript is used in client side scripting so is there any language which can replace Javascript?

Is there any language which we can use for the purposes for which we use java Script.

Your opinions and replies will be Highly appreciable.

+1  A: 

There are plenty of places that JavaScript is used that have nothing to do with client side scripting, but to answer the question I think you are asking:

There is no programming language that can run client side in browsers, which has access to the DOM, and has anywhere near the support that JavaScript has.

If you limit yourself to Internet Explorer, then VBScript might be an option. This is hostile to the web, and imposes restrictions on software choice within a company in an Intranet environment.

If you don't need access to the DOM, or want to interface with JavaScript for just DOM manipulation, then ActionScript (via Flash) and .NET languages (via Silverlight) become an option. Support for these is not as wide as vanilla JavaScript though.

If you are willing to dump through a layer of abstraction (with the complications and limitations that implies) then tools such as GWT will let you write in one language and translate it to JavaScript in a "compilation" step.

David Dorward
A: 

If you are referring to Javascript as used exlusively by web browsers:

  • Not directly, since the browsers all support javascript exclusively. But there are javascript libraries/frameworks you can use that allow you to build client-side applications in other languages.

    For example: http://www.haskell.org/haskellwiki/Haskell_in_web_browser

    Another option would simply be to use an x->javascript compiler where x is your language of choice.

If you are referring to Javascript as used everywhere else:

  • You can very easily use other languages for such tasks. Simply pick a language that you like, and use it instead!
Cam