最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Javascriptjquery in windows applications - Stack Overflow

programmeradmin0浏览0评论

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

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

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

Any response or ment is wele.

Thanks in advance :)

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

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

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

Any response or ment is wele.

Thanks in advance :)

Share Improve this question asked Dec 2, 2011 at 13:26 Teun PronkTeun Pronk 1,39714 silver badges25 bronze badges 1
  • What do you want to do with JQuery in windows forms? – Mahdi Ghiasi Commented Dec 2, 2011 at 13:51
Add a ment  | 

6 Answers 6

Reset to default 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 UI isn't going to be possible.

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.

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.

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.

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 mand line. I haven't figured out how to debug it, but hey.

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

There is also JScript.NET.

发布评论

评论列表(0)

  1. 暂无评论