2

This might be a stupid question but is it possible to use javascript/jQuery in windows applications?

Im making this application in vb.net, just for personal use and im just making it to practice and to learn more about vb.net programming.

I know javascript is ment for web applications but maybe there are ways to use them in windows applications aswell.

Any response or comment is welcome.

Thanks in advance :)

Teun Pronk
  • 1,367
  • 12
  • 24

6 Answers6

4

You may be able to find some success with something like Jint to run JavaScript code, but JQuery relies heavily on the presence of the DOM, so using JQuery to work with a VB.net UI isn't going to be possible.

Andrew Church
  • 1,391
  • 11
  • 13
1

cscript, wscript and the Windows Scripting Host objects allow you to do things that you can't do from within a browser, but these are very much limited to scripting tasks, and won't allow you to create a GUI.

It is possible to create a VB application that does little more than host a browser window. You could use such a browser window to create a rich jquery UI.

By setting the window.external property from your VB app (see this question and this HOWTO), you can give the embedded browser access to things outside the browser environment, thereby enabling it to interact with the local machine in a manner normally forbidden by a browser.

Community
  • 1
  • 1
Paul Butcher
  • 6,902
  • 28
  • 39
0

HTML applications (HTA) may give you what you're looking for. They don't seem to get much attention these days but try changing our .htm suffix to .hta and then run it from the command line. I haven't figured out how to debug it, but hey.

ekremkaraca
  • 1,453
  • 2
  • 18
  • 37
0

You might want to look at Real Oop with AutoIt and Smuggling Autoit into IE Embedded

There is also JScript.NET.

Mark Robbins
  • 2,427
  • 3
  • 24
  • 33
0

I have to disappoint you, this is not possible. Unless there is some browser-emulator tool or some js-engine under the hood in your application, there is obviously no way to link those worlds.

However, if you like the javascript syntax, you can use node.js also on windows platforms. But there again, it is not possible to access the windows API. But there might be a plugin which allows for that.

jAndy
  • 231,737
  • 57
  • 305
  • 359
0

Write a Metro application?

You write Metro style apps using familiar technologies like HTML5, JavaScript, and CSS3, or XAML, with C++, C#, or VB.Net code-behind.

MarkJ
  • 30,070
  • 5
  • 68
  • 111