Using javascript for scripting?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • X Enterprises
    New Member
    • Dec 2007
    • 15

    #1

    Using javascript for scripting?

    How would I go about making a windows application extensible with JavaScript?

    Thanks. :)
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    JavaScript is a web scripting language. It is run in web browsers to provided wonderful client side enhancements that can make your web pages much more interactive.

    JavaScript cannot be used in windows applications.

    Comment

    • X Enterprises
      New Member
      • Dec 2007
      • 15

      #3
      Okay.

      Is there some other scripting language for .NET similar to JavaScript?

      Comment

      • PRR
        Recognized Expert Contributor
        • Dec 2007
        • 750

        #4
        If you are developing windows application then you have rich functionality in all controls like mousehover, mouseclick etc... As asp.net code executes on server, this kind of functionality( client click, onmousehover) cannot be provided... therefore client side scripting is used....Imagine have to postback to server on "mousehover ", the user will have to wait for ever for any functionality.. . To achieve this, "something" that runs on client side is used... Javascript is that "something" ..
        As for windows application the code executes on the client side therefore rich features like "mousehover " are executed on client... There is no use of JavaScript...

        Sample windows application on button MouseHover event ...
        Code:
        private void button1_MouseHover(object sender, EventArgs e)
                {
                    MessageBox.Show("Mouse over me "+((sender)as Button).Text);
                }

        Comment

        • X Enterprises
          New Member
          • Dec 2007
          • 15

          #5
          I understand that there is no JavaScript for windows applications and I know how JavaScript works in a web page. I also have much knowledge in mouse events and I know how to handle them.

          What I was asking was: Is there a scripting language that can be used in .NET apps that is similar to JavaScript. (In syntax.)

          Comment

          • PRR
            Recognized Expert Contributor
            • Dec 2007
            • 750

            #6
            Well ...i didn't get your question right then.... in addition to java script you can also use VBScript

            Comment

            • Frinavale
              Recognized Expert Expert
              • Oct 2006
              • 9749

              #7
              I didn't actually understand the question either apparently.
              Every language is different. C# uses curly braces and semicolons in it's syntax, so I guess it's closer to JavaScript than VB.NET; but, C# is a completely different animal (with keywords such as Class and functions that specify return types etc).

              -Frinny

              Comment

              • musicfreak
                New Member
                • Jan 2009
                • 17

                #8
                Take a look at IronPython.

                Comment

                Working...