Javascript in delphi applications

Is it possible to use javascript when creating applications for Windows desktop computers. I am using borland delphi and I need to use javascript in my grids.

+8
javascript delphi
source share
4 answers

Worm, I wrote you a complete solution. See the screenshot attached below ...

The main summary of what I can give is ... a component that allows you to execute javascript, call delphi from javascript and access javascript functions and objects after connecting the script.

Here is a link to a short article . I wrote a description of what you can do with javascript. At the end of the article is a zip file containing the source code and a compiled sample program that you can use to test any javascript that you want to write.

enter image description here

+17
source share

AJAX is a technology commonly used in web applications where the client runs javascript. Such concepts are very difficult to apply in desktop applications. You can use background threads to perform expensive tasks so as not to freeze the application, and then update the user interface with the results of these background tasks.

+2
source share

Thanks a lot sysrpl.

This solution is based on ActiveX and Internet Explorer. You need to write too much extra code for every JavaScript / fearture function that you intend to use.

I highly recommend taking a look at the javascript SpiderMonkey cover (Firefox). He is ready for RTTI.

http://code.google.com/p/delphi-javascript/

Only 1 DLL required. Compatible with XE2 / XE4 / XE5. Ready for x86 and x64 systems.

+2
source share

You can use one of the JavaScript interpreters available on the market. First of all, it is the Windows Scripting Engine itself, which offers JScript (the delphi shell is required for convenient operation). Next, FastScript FastReports. There are more available, but I don’t remember the names at the moment.

The problem, however, is that the language itself is not enough. You seem to need to use JavaScript code that uses the HTML DOM and various browser classes. Obviously, they are not available if you do not have the browser mechanism in your program. That is, if you insert a TWebBrowser or a link to the Mozilla engine, you get a browser, and you can run scripts inside the browser window.

But if you want to automate the Delphi GUI with JavaScript, this is probably not the best idea - browser-based JavaScript code will be useless for this.

+1
source share

All Articles