Open MDB file with JavaScript - javascript

I'm currently working on a ionic app with Visual Studio. My final goal is to open a MDB database (Microsoft Access) that is located in a distant server. I suppose that I have to use a PHP file to accomplish it.
So I have a lot of questions:
- Is it possible to communicate with a MDB file througt JS in a Cordova app?
- How to include the PHP file to my JS?
Thank you in advance and sorry for my english, I'm not a native.

If you want JS to be able to talk to or change a MDB database, you'll need to build a PHP page on your web server that talks to the MDB database instead, and then talk to the PHP page with Cordova/JS.
Examples:
https://www.sitepoint.com/using-an-access-database-with-php/
Your PHP page should return JSPONP though (not regular HTML), and you can call your PHP page via jQuery. Here are other examples:
Simple jQuery, PHP and JSONP example?

Related

Auto update local webpage when image file is changed?

I'm working on a twitch.tv overlay that generates a word cloud live on-screen based on what I've been saying on stream.
I'm currently using Visual Studio Code with Live Server to display a file via an HTML file alongside a Python script that generates a new png file of the word cloud, using the same filename.
Using the Live Server extension is nice, but I can't help but feel like it's sort of a dirty solution. Any ideas on something more formal?
NodeJs and Express could be a good option. The server could be written in Javascript and you could use a sub-process to call your python script on an interval.

How to add a python program to a web project?

I have this code that detects face and eyes ( face recognition ) and it runs in python and appears in pycharm when it run as a cam window ,so I am asking how to add this window as a part of a web page project that is written in html css and javascript so it appear as a part of the web page
You'd need to use the Flask or Django lib for python to do this. More info about Flask can be read on their website: https://flask.palletsprojects.com/en/2.0.x/
I've never tried Flask with JavaScript, but I do know that python is the better than for example PHP

Setting up a PHP environment using Atom ( for HTML+CSS+JS+PHP development)

I’m seeking your support and expertise today. I’ve started a project using html, css, and js and I'd need to add php to the file to enter & store data; I’m fresh to PHP programming- and before I begin to program my php file, I know I have to set up my environment for building php with Atom and storing my data to Workbench.
My question, how do I setup ATOM for PHP development using MySQL Workbench on my Mac to connect to a local host viewed index.html file, and allow the user to fill out my form (my program is a simple invoice for quotes) on a html file and send the info back to workbench?
How do I set up Atom, and what code do I use to connect my index.html file to the sql-workbench, or what do I have to do? What packages should I download, what steps do I take? any recommendations?
I tried researching on how to set up the environment but still lost as to what to do. (Also, I'm open to other platforms that work as well with ATOM- so keep that in mind in your response.)
First, rename your index.html to index.php. With that you can insert php code within the file.
Here's some useful Atom packages to ease you for coding:
https://atom.io/packages/atom-autocomplete-php (useful to
autocommplete php codes)
https://atom.io/packages/autocomplete-html (useful to
autocommplete php codes)
https://atom.io/packages/atom-ternjs (autocomple for javascript code)
https://atom.io/packages/atom-html-preview (works only for .html page
not php)
https://atom.io/packages/project-manager (manage
multiple projects of web development for example)
you need a webserver installed in your machine like MAMP or WAMP to run your php/mysql websites.

making exe form HTML and Javascript

I was wondering I have PHP based server side stuff that accepts ajax requests and sends back JSON for JS. And I have HTML and JS based "client" now I would like to create exe(windows aplication) that would look the same as the "client" in browser but without browser. Preferably somehow grab that HTML and JS and "compile it" to regural client that would still send out AJAX calls and procesing JSON data.
Edit:
To clarify things:
Server(on webserver) is PHP procesing incoming AJAX calls and diplaing JSON as result.
Client(what I want to convertt to exe) is HTML and JS(Jquery) page(application).
I want for user to have option two to dowload client for windows so he/she dont have to use browser.
With https://electron.atom.io/ from Github you can develop Windows, Mac and Linux applications with Javascript, Html and CSS. You can also build mobile application with your web development skills. https://cordova.apache.org/.
You can use Electron, but if you just want something quick and easy to use, try Scriptonit. It's exactly for this kind of use. (Check out the documentation and the examples to see if this is the one for you.)
It's basically one exe plus a few sidecar files in a folder called app/, then it just works like a local browser without the frames & head. Also, it can access local files and run OS commands, even capture their output.
Side note 1: Yes it's mine, as you can see on the link - but no, that's not why I'm recommending it
Side note 2: It's 0.9 so it's not perfect, let me know if it misbehaves.
I don't think you can make a desktop application with markup languages. but then am also a newbie in this stuff but what I think you need is to develop a GUI in a programming language like java for example Swing docs.oracle.com/javase/tutorial/uiswing/ to mimic the apearance of your webpage. Then connect to your server by socket programming.

How to show browse for FOLDER window(not browse for file)using just JSP and javascript?

I need a code for how to browse for folder (not file) using JSP and Javascript.
I looked for the JAVA code for browse for folder using JFileChooser library but I want the default window to be opened (which opens in browse for file).
I'm developing a webapp which will scan the folder based on the path and will generate the output.
Thanks in advance.
1.I need a code for how to browse for folder (not file) using JSP and Javascript.
Javascript does not have access to the file-system due to security reasons, as this answer says and also this answer.
So you would have to use flash or java applet as suggested in this answer or else you would have to wait till the time HTML5 File API matures :-)
But, if your requirement is that your a User (may be with administrator rights in the application) logins to the web-application through a web-browser and wants to scan (view the contents of) the particular folder on the server side (where the web-app is deployed and not the file system on his own machine) then you can use the suggestion given in this answer, just to elaborate on this:
Have a <form> which will have a text-box (to take the folder name or full-path) in the JSP, on submit of this form a request will be sent to the server.
The response would be list of files (List<String>) in that particular folder passed through the request.
you can also submit the request through ajax in which case you would return a JSONArray as suggested.
Now on the Server it would be normal Java File API stuff to fetch all the files in the folder you get from the request.
Sorry to say this but I don't think you would get a ready-made code to do what you want and that is not how things work on SO.
2.I looked for the JAVA code for browse for folder using JFileChooser library
You said you are building a web-app right? JFileChooser is a Swing component and as far as I know cannot be used in JSP to achieve what you desire.
3.I'm developing a webapp which will scan the folder based on the path and will generate the output.
The steps are explained in point (1).
Hope this helps and gives relevant hint and direction to go forward.

Categories

Resources