am new to django and jquery,I am searching for a 'hello world' sample for jquery
using django1.3, Where hello world is returned as a string /json from the server to the client when user press a button or at loading of the page.
Note: I am using django1.3 and python 2.7.Sorry this is a very basic question.
I successed in a `shows a string "This is Hello World by JQuery" with out any view functions(using jquery only) .But am unaware of how to use view functions from jquery functions If any one have idea please help me.Thanks in advance.om templates I tried using following code snippets.
urls.py
(r'^hellofromserver/$',views.test),
def test(request):
if request.method == 'GET':
json = simplejson.dumps('hello world!')
return HttpResponse(json, mimetype = 'application/json')
jqueyhelloserver.html:
<html>
<head>
<title>jQuery Hello World</title>
<script type="text/javascript" src="{{STATIC_URL}}js/jquery-1.2.6.min.js"></script>
</head>
<body>
.....
<script type="text/javascript">
# how can I get'hello world' from test function(What is the sytax )
</script>
<div id="msgid">
</div>
</body>
</html>
How can I call the functions 'test' and 'hellofromserver' from jquery?(from templates).