Website Architecture Question
If our website's backend is expose via apis (secured and everything) , is it a good idea to develop the website only in JQuery?
Like one commenter said, JQuery will be calling the API's.
Edit again: The entire idea behind this is to achieve scaleability. For exampl开发者_运维技巧e, the same api's could then be used on Mobile or something else.
jQuery is only a java script framework. It has nothing to do with exposing your backend as api's.
*EDIT*
After looking at other peoples response, may be you are talking about developing the front end only for a web application whose back end is already exposed as api's. In that you can do that using jQuery. But it would definitely be not a search engine friendly and not accessible completely and not usable for people who don't have javascript enabled.
If you're asking whether you can develop a complete client-side application that uses jQuery (or any Javascript for that matter) to call all of your back-end APIs via AJAX, etc, you certainly could.
I wouldn't recommend it though, as it would completely cripple your entire site for users with Javascript disabled.
Just leaving this here, but a while ago I read a nice blog post about the very issues you are dealing with.
Check it out: http://omergertel.com/2010/08/05/on-websites-apis/
If the website's primary purpose is to present content to the world, then I'd strongly advise against such an approach. Not only will you lock out users who cannot or will not enable javascript (think audio browsers, people with really really old software, sub-smartphone mobile devices, etc.), you will also effectively hide all your content from search engines.
If, however, it's a web 2.0-ish thing that resembles an actual application more than a content-presenting web site, then programming it in javascript might be a viable solution - but again, you'll miss out on search engine hits and javascript-agnostic users.
Also, note that there is nothing stopping you from calling your api's from server-side presentation code (ASP.NET, PHP, JSP, whatever you fancy).
there are many options for developing a web application around an API. JQuery is only one option. The answer depends on what you are trying to accomplish...
精彩评论