Any good AJAX framework for Google App Engine apps

2019-03-09 11:55发布

I am trying to implement AJAX in my Google App Engine application, and so I am looking for a good AJAX framework that will help me. Anyone has any idea?

I am thinking about Google Web Toolkit, how good it is in terms of creating AJAX for Google App Engine?

12条回答
forever°为你锁心
2楼-- · 2019-03-09 12:32

I'd recommend looking into a pure javascript framework (probably Jquery) for your client-side code, and write JSON services in python- that seems to be the easiest / bestest way to go.

Google Web Toolkit lets you write the UI in Java and compile it to javascript. As Dave says, it may be a better choice where the backend is in Java, as it has nice RPC hooks for that case.

查看更多
Juvenile、少年°
3楼-- · 2019-03-09 12:32

jQuery is a fine library, but also check out the Prototype JavaScript framework. It really turns JavaScript from being an occasionally awkward language into a beautiful and elegant language.

查看更多
别忘想泡老子
4楼-- · 2019-03-09 12:36

You may want to have a look at Pyjamas (http://pyjs.org/), which is "GWT for Python".

查看更多
ゆ 、 Hurt°
5楼-- · 2019-03-09 12:41

A nice way is to use an AJAX library is to take advantage of Google's AJAX Libraries API service. This is a bit faster and cleaner than downloading the JS and putting it in your /static/ folder and doesn't eat into your disk quota.

In your javascript you would just put, for example:

google.load("jquery", "1.3.2");

and/or

google.load(google.load("dojo", "1.3.0");

Somewhere in your header you would put something like:

<script src="http://www.google.com/jsapi?key=your-key-here"></script>

And that's all you need to use Google's API libraries.

查看更多
Animai°情兽
6楼-- · 2019-03-09 12:41

There is no reason why you shouldn't use GAE and Google Web Toolkit (GWT) together. You write your backend code in Python and the frontend code in Java (and possibly some JavaScript), which is then compiled to JavaScript. When using another AJAX framework you will also have this difference between server and client side language.

GWT has features that make remote invocation of java code on the server easier, but these are entirely optional. You can just use JSON or XML interfaces, just like with other AJAX frameworks.

GWT 1.5 also comes with JavaScript Overlay Types, that basically allow you to treat a piece of JSON data like a Java object when developing the client side code. You can read more about this here.

Update:

Now that Google has added Java support for Google App Engine, you can develop both backend and frontend code in Java on a full Google stack - if you like. There is a nice Eclipse plugin from Google that makes it very easy to develop and deploy applications that use GAE, GWT or both.

查看更多
Viruses.
7楼-- · 2019-03-09 12:42

As Google Web Toolkit is a subset of Java it works best when you Java at the backend too. Since Google App Engine is currently Python only I think you'd have to do a lot of messing about to get your server and client to talk nicely to each other.

jQuery seems to be the most popular JavaScript library option in the AJAX Tag at DjangoSnippets.com.

Edit: The above is only true of Google App Engine applications written in Python. As Google App Engine now supports Java, GWT could now be a good choice for writing an AJAX front end. Google even have a tutorial showing you how to do it.

查看更多
登录 后发表回答