1

When I say "Vanilla Coding", I am referring to websites that don't utilize server side coding (such as PHP, ASP, etc.), only HTML, JavaScript, and CSS.

I know that there are a plethora of sites that already exist that don't utilize (to my knowledge) any of the common, server side languages used by many others (PHP, ASP, etc.), but still function just fine!

I am confused! How do these sites continue to save login information, keep records, etc. etc. without using a server side scripting language? Is there something that I am missing? Can JavaScript access more (such as databases and local files) than what I thought it could?

EDIT

Turns out I've made a serious and shameful mistake in assuming that just because it ended with a .html extension that it was client-side only. That is okay though because I'm learning. Thanks so much for the help everybody!

Freesnöw
  • 30,619
  • 30
  • 89
  • 138
  • 8
    Do you have an example of these "plethora of sites"? You do realize that a website can use `.html` as the page endings and still be using a server-side language (or no ending at all)? Also, a page can post from `theform.html` -> `processform.php` -> `thankyou.html`, which utilized a server-side page to process but you never saw it. And yes, `AJAX` technically can save login information, keep records, etc. entirely using `JavaScript` - but they will be talking to some server-side page somewhere. – mellamokb May 16 '11 at 18:29
  • @mellamokb Was there not a time before these server side scripting languages started that this all worked? Really, I don't know, you are probably right, that is why I am asking the question. Here, have a point for the time being... – Freesnöw May 16 '11 at 18:32
  • 1
    @DalexL - there was always a server-side something if databases and dynamic applications were involved. They were just called `CGI` way back when and written directly in `C` (or such like) instead of higher-level languages like `PHP` and `ASP.Net` with fancy tools like `IIS` or `Apache` to abstract away all of the underlying technology. – mellamokb May 16 '11 at 18:34
  • 1
    There was never such a time. I bet you within 24 hours of the first web site that was created using HTML coming online sometime around 1990, some clever guy figured out he could make a perl script generate HTML dynamically. They used to call it "cgi. " – Jamie Treworgy May 16 '11 at 18:35
  • @mellamokb Is it a bad idea to utilize CGI? What are the differences? – Freesnöw May 16 '11 at 18:35
  • 1
    @DalexL; @mellamokb: And even before that, you didn't even have dedicated web servers, just programs written in C that implemented whatever bits of HTTP or, as was sometimes the case, Gopher they damned well pleased. – Williham Totland May 16 '11 at 18:36
  • @mellamokb, btw, thanks for the help. Have some more points! You should have posted it as an answer but Williham Totland helped quite a bit. – Freesnöw May 16 '11 at 18:37
  • 1
    Oh - GET and POST are part of HTML 1.0: http://www.w3.org/Protocols/HTTP/1.0/draft-ietf-http-spec.html#GET So I think we can assume that the "founders" had thought of server side processing from the outset. There would be no point in anything other than a parameterless "get" if there were no server side processing. – Jamie Treworgy May 16 '11 at 18:42

5 Answers5

3

Essentially, unless you have some sort of server-side programming, you don't stand a chance at making a site with any amount of functionality. To break it down for you:

What you can do without server-side scripting:

  • Serve static pages

What you need server-side scripting for:

  • Absolutely everything else

Even something so simple as keeping a site consistent and up to date is a nightmare on wheels without, at the very least, some some sort of management system that pre-generates the static pages to be served. (Technically, one could argue that Copy+Paste in Notepad counts as this.)

As has been mentioned elsewhere; obfuscating the true nature of precisely what system is being used is trivial; and having URLs ending in, say, .html while using PHP is no issue.

Edit: In the most perverse case I can think of off the top of my head, you could have a lighttpd server masquerading as an IIS server, serving pages generated by an offline renderer fed to it by a Perl FastCGI script, sent together with PHP signature heading and using a mix of .asp and .jsp file extensions.

Of course, noone would do something as silly as that. I think…

Williham Totland
  • 28,471
  • 6
  • 52
  • 68
  • @DalexL: Well, here's the thing, tho'. It doesn't matter. Not one bit. As a user of the content, you shouldn't need to care, you shouldn't want to care, and you sure as hell shouldn't care one bit. – Williham Totland May 16 '11 at 18:41
2

This answer is very late but I leave this reply for anyone who may stumble upon it.

Using javascript/jQuery, and various APIs a simple site can be created only using client-side coding.

For instance, a simple shopping cart type of site can be created. I've done it before.

There are few (not many) strictly 100% jQuery based shopping cart solutions that are open-source.

How does the PG (pay gateway) get taken care of? You are limited to accepting payment through paypal, google checkout, and direct deposit.

What about allowing customers to leave comment? You can use API's like Disqus. What about chat support? Zopim is pretty handy.

How do you get notified when purchase is made? Paypal & google checkout notifies you.

What about sending mass email? Mail Chimp.

Personally, I almost always use WordPress or some other types of CMS but using only vanilla coding to build a simple site is not only feasible but very sensible in certain circumstances.

Matthew
  • 117
  • 2
  • 11
2

No client side script can access server side information (like a database) without some sort of server side communication (through something like ajax or the like)

If you really ( i mean really as in don't do it ) want to do logins and the like on clients side, you would have to make some sort of cookie that you store on the user's computer, also you would need a list of users (which anyone can read) to use against

Naftali
  • 144,921
  • 39
  • 244
  • 303
1

Nowadays a lot of sites are using Javascript as a server side solution, Node.js being the most popular. Check out this list: https://github.com/joyent/node/wiki/Projects,-Applications,-and-Companies-Using-Node

Swarup Sengupta
  • 131
  • 1
  • 2
1

You're not going to see whether a site is using a server side language unless they let you see the file extensions. With URL rewriting, MVC patterns, etc., it's easy to hide, or even fake that information. Therefore, chances are very good that the sites that you think aren't using a server side language are actually using one.

Now, a site can save certain information in cookies, such as some basic preferences, but any authentication they appear to be doing wouldn't actually be doing anything without a server-side script accessing a database somewhere.

As a side note - I have worked on a site where the content was actually static, but made to look like a blog or CMS. It was an absolute nightmare and hugely error-prone.

What are these sites that you think aren't using server-side scripting?

Shauna
  • 9,495
  • 2
  • 37
  • 54