14 messages in com.googlegroups.google-appengine[google-appengine] Re: Ajax| From | Sent On | Attachments |
|---|---|---|
| crgwbr | 28 Apr 2008 15:05 | |
| Matteo | 28 Apr 2008 16:13 | |
| crgwbr | 28 Apr 2008 16:41 | |
| crgwbr | 28 Apr 2008 16:48 | |
| Matteo | 28 Apr 2008 16:54 | |
| crgwbr | 28 Apr 2008 17:35 | |
| Matteo | 28 Apr 2008 18:01 | |
| manatlan | 29 Apr 2008 02:20 | |
| Peter Svensson | 29 Apr 2008 03:06 | |
| crgwbr | 29 Apr 2008 04:49 | |
| Matteo | 29 Apr 2008 06:09 | |
| palp | 30 Apr 2008 00:58 | |
| Mike Garcia | 30 Apr 2008 09:00 | |
| crgwbr | 30 Apr 2008 15:15 |
| Subject: | [google-appengine] Re: Ajax![]() |
|---|---|
| From: | Peter Svensson (psve...@gmail.com) |
| Date: | 04/29/2008 03:06:53 AM |
| List: | com.googlegroups.google-appengine |
You can use any Ajax framework to access you app. I would recommend Dojo :)
Cheers, PS
On Tue, Apr 29, 2008 at 11:20 AM, manatlan <mana...@gmail.com> wrote:
use jquery to make your ajax call ... it works like a charm on dev localhost, on appspot subdomain, and on real domain (google app)
On 29 avr, 03:02, Matteo <matt...@gmail.com> wrote:
I've just done a little test by my own.
Meanwhile i was using 127.0.0.1:8080 i wasn't able to get XMLHTTPReq working, as soon as I started dev_appserver.py --port=80 it worked fine for me.
hope this helps.
On Apr 29, 2:35 am, crgwbr <crg...@gmail.com> wrote:
The app isn't online yet, so the IP of dev_appserver.py is localhost (127.0.0.1).
On Apr 28, 7:55 pm, Matteo <matt...@gmail.com> wrote:
wait, if you are using an online account of google app engine with an appspot.com domain you have to set something like
var url = "http://yourthirdlevelname.appspot.com/main/"
On Apr 29, 1:48 am, crgwbr <crg...@gmail.com> wrote:
Update: changing the URL in that way didn't change any thing.
On Apr 28, 7:42 pm, crgwbr <crg...@gmail.com> wrote:
k, so you are saying it should be:
var url = "http://localhost:8080/main/" + escape(tab);
I'll give this a try, but when I upload this to Google's servers, it seems like the link will break. So, I doubt this will work a a permanent solution. I'll post when I've given it a try.
Thanks, Craig
On Apr 28, 7:14 pm, Matteo <matt...@gmail.com> wrote:
Mhh looking at this i had only a little doubt about this:
var url = "/main/" + escape(tab);
are you sure haven't you to add your dev_appserver ip too in
that var?
On Apr 29, 12:05 am, crgwbr <crg...@gmail.com> wrote:
I'm trying to write a page that interacts with the server via AJAX. The Javascript seems to work to a limited extent, but it receives no response from the server. Also, the dev_appserver.py window doen't show any interaction when the javascript shold be submitting and receiving things.
Javascript functions:
<script type="text/javascript">
function bodyUpdate(tab) {//v1.0 var request; try { request = new XMLHttpRequest(); } catch (trymicrosoft) { try { request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (othermicrosoft) { try { request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (failed) { request = false; } } }
if (!request) alert("Error initializing XMLHttpRequest!");
var url = "/main/" + escape(tab); request.open("GET", url, true); request.onreadystatechange = updatePage(); request.send(null);
}
function updatePage() { var loading = '<p class="style1"><span class="style3"><strong>Loading...</strong></span></p>'; var finished = '<p class="style1"><span class="style3"><strong>Finished</strong></span></p>';
document.getElementById("body").innerHTML = loading; if (request.readyState == 4) { if (request.status == 200) { var response = request.responseText; document.getElementById("body").value = response; } else alert("status is " + request.status); }
}
</script>
Python:
class UpdateNextActions(webapp.RequestHandler): def get(self): tasks = database.Task.all() if users.get_current_user(): tasks.filter('creator =', users.get_current_user()) tasks.order('date') template_values = {'tasks':tasks} path = os.path.join(os.path.dirname(__file__), 'NextActionsTemp.htm') self.response.out.write(template.render(path, template_values)) else: self.redirect('/')
All help is appreciated.
Thanks, Craig
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to goog...@googlegroups.com
To unsubscribe from this group, send email to
goog...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---




