In controller,
I have a user class
{u'test': <__restricted__.User object at 0x00000000099D8F98>}
>From the view I tried the ajax call and not being able to pass the users.
'url' :
'{{=URL("put")}}/{{=uid}}/{{=room}}/{{=users}}',
It doesnt work.
I tried.
'data' : {'message': message , 'users:users'},
I will be able to provide more info.
Trying to pass that into a ajax call. Not sure how. Any help?
{{=users}}
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Main</title>
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
$('#newmessage').submit(function(e) {
var message = $("#messageinput").val();
$.ajax({
'type' : 'POST',
'url' :
'{{=URL("put")}}/{{=uid}}/{{=room}}/{{=users}}',
'data' : {'message': message },
'dataType' : 'json',
});
$("#messageinput").val('');
$("#messageinput").focus();
e.preventDefault();
});
var longPoll = function() {
return $.ajax({
type: "POST",
url: '{{=URL("poll")}}/{{=uid}}/{{=users}}',
async: true,
cache: false,
timeout: 100000,
success: function(data) {
if (data.length > 0) {
$("#messages").append($("<li>" + data + "</li>"))
}
return longPoll();
},
dataType: 'json'
});
};
longPoll();
});
</script>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.