0

Can one create a complete web app just using client side/front end technology? for example: with Javascript on the client side, can I access databases, display the the html and data, do all the logic of the web app, etc without writing any server code nor using something like node.js? just using a simple web server.

Robert Harvey
  • 178,213
  • 47
  • 333
  • 501
Der
  • 283
  • 2
  • 7
  • What would you consider a "simple web server"? But the likely answer is, no, you can't. You need *something* on the server listening to your requests. If you don't have that, you're just retrieving static web pages. That said, there's nothing saying you need a *remote* web server - your client-side code can operate on local data. – Michael Petrotta Jul 02 '12 at 01:33
  • a web server like apache httpd to host local html and css and database like sqlite or mysql, can data be inserted and displayed from the DB with just client side JS? can the a web app be created just this way? doing all the logic on the client side – Der Jul 02 '12 at 01:39
  • Depends what kind of logic you want to do. If it's anything that needs to communicate with a server (like reading or writing to a database on that server), then you'll need an application server (like Tomcat, which is free and a good place to start). – Michael Petrotta Jul 02 '12 at 01:46

2 Answers2

1

You can create simple website using HTML & Javascript only, but you can't connect to database.

Therefore, it really depends on the website you want to create and its functions.

If you performed little search here you would have found the answer :)

Here is a similar question answered Can JavaScript connect with MySQL?

Community
  • 1
  • 1
Ali Mike
  • 66
  • 5
  • I have thought maybe AJAX provided that? – Der Jul 02 '12 at 01:45
  • @Der well again, it depends on what data you want to retrieve, if it is stored in a static file eg: data.txt, users.json ...etc, Yes you can use Ajax but if you are using database like Mysql or your files are dynamic, then unfortunately you can't as Javascript can't access databases nor open and edit files. – Ali Mike Jul 02 '12 at 02:28
1

Yes, writing an extension for browsers like Firefox and Chrome. Take into account that an extension is different than an offline application. The later is a different approach and is more limited. For example, add-ons can connect to every site but javascript scripts loaded for a specific locations have other security limitations.

Another approach is distributing an application executable with an embedded web browser but I think this not part of the answer you are looking for.

sw.
  • 3,240
  • 2
  • 33
  • 43
  • correct, I'm talking more about a normal web app that can be accessed with any web browser with out using any extension or installing some program. – Der Jul 02 '12 at 01:41
  • Then the closest thing are offline applications: http://www.html5rocks.com/en/features/offline you have local support for local sql databases (implemented internally in Firefox and Chrome with sqlite) – sw. Jul 02 '12 at 01:45