that kind of specifications (ajax-like but no ajax) sound very weird
to me. I find only two explanations:
A) you don't know how HTTP works
or
B) when you say 'ajax' you're in fact talking about a specific library
that you don't want to use and not the generic javascript-driven
requests.
if A, then please do learn about HTTP first. then you'll not only
realize what you really need, but will also be in position to make
your applications like you want.
if B, then please tell us what is it that you don't want.
--
Javier
--You received this message because you are subscribed to the Google Groups "Django users" group.To post to this group, send email to django...@googlegroups.com.To unsubscribe from this group, send email to django-users...@googlegroups.com.For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
but for the web html standart you need ajax.
maybe you can use some javascript framework like prototype+scripatoulus or jquery to simply work with ajax and browser compatibility issue.
i think you really need to check how HTTP works.
in HTTP, the server can't "push" anything to the browser. the browser
has to ask for it.
Django runs exclusively in the server.
the only browse-side coding environments are javascript and some
plugins (flash, Java, silverlight). in general, only Javascript is
practical.
you want to replace part of the webpage with different content,
probably in response of some user interaction. That has to be
initiated at the browser. Since you don't want to replace the whole
page, it has to be some Javascript code that 'pulls' the new content
from the server and replaces some part of the page with it.
guess what? that javascript-driven requests are called AJAX (even if
the 'X' doesn't imply XML anymore).
using a javascript library it can be real simple. in jQuery it's:
$('#partid').load('http://some.url/with/new/content');
from the Django point of view, it will simply get a request for the
new URL, and it should return the partial content. jQuery will patch
it replacing the content of the '#partid' element of the page
but you _really_ have to understand HTTP and javascript to go from
there to anywhere else.
--
Javier
It's definitely weird, but its not crazy. I'm almost certain the OP
does want to use AJAX, but there are AJAX-like techniques that we used
to do AJAX-like things before XMLHttpRequest existed.
The most common way is to use javascript to programmatically load
content into a hidden <iframe>. The returned content should have a
<script> tag at the end of the content that runs after the content has
been loaded to achieve whatever it is that you wanted to achieve, eg
move the loaded content into a visible part of the webpage, or replace
some content with the loaded content.
You can also use the existence of javascript to make the iframe
visible/not visible. I've used this technique to load content
asynchronously to the main page, which then works regardless of
whether the user has javascript enabled - if it isn't enabled, the
content loads into the (now visible) iframe, otherwise if javascript
is available it is loaded into the (invisible) iframe, and javascript
used to move the content from the iframe to the appropriate part of
the main page.
It's not AJAX, but it is AJAX-like. It's also bloody stupid, use AJAX.
Cheers
Tom
--
Javier
Perhaps it's a trick question?
Maybe you project guide does not like the "Ajax" buzzword? :)
Just call it XHR:
<http://www.quirksmode.org/js/xmlhttp.html>
<http://en.wikipedia.org/wiki/XMLHttpRequest>
On a more serious note...
I have never used, and this might be a wild goose chase, but what
about html5 WebSockets?
<http://pypi.python.org/pypi/django-websocket>
<http://dev.w3.org/html5/websockets/>
The first answer here does a nice job at explaining the difference
between XMLHttpRequest and WebSocket technology:
Good luck!
Cheers,
M
Hello,
Did you look at dajax and dajaxice extensions for django so far? It might help.
Good point. I guess it depends on the requirements of the project.
From what I read, this sounds like a school project, so why not take
the time to explore state of the art web technologies?
Cheers,
Micky
Yours,
Russ Magee %-)
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>
--
Sent from my mobile device
ajax use usualy load a div part of html with new content fetch from the server when user do something,like click a submit button. and django process the request as a simple usual request.
i have using prototype+scriptocolous for the simple syntax to make an ajax form.
i see the jquery version also but a bit trouble coz need to add the event manually.
and remember the crsf token when using ajax request..will need it generated properly..
anyone using prototype to?
or anyone have better way with ajax