Hi I am still new to Django and have not worked with Ajax before.
I am building an app where two players are able to chat, so it's basically a chatbox and I want the page to update for one player when the other player enters text on their page. I was wondering if anyone had any good resources for this type of functionality?
Thanks so much!
You might want to try html5 websocket.
For JavaScript and ajax, refresh the page at a timed interval. Or better fetch new messages via an ajax call and append to the DOM.
Related
I'm using tastypie + django + backbone.js . My application should be usable by more than one user at a time.
What I want to do is to show all users "live" changes on the database without having the users manually reloading the page.
Anyone around to point me in the right direction?
Thanks
To get this working in all major browsers you will have to periodically send an AJAX request to your server asking if any changes have occured.
In modern browsers you could make use ob web sockets to setup a PUSH service where the server can push those changes to your application or simply notify you about it.
(If you are using Backbone as an MVC framework anyway you might as well step back from the idea of reloading the page and just request your data using AJAX and use Backbone's View component to render your data into HTML elements)
Hi I'm currently developping an app using Jquery mobile, now I want to save some feedback from my users using Ajax. The problem is (I think) that my Ajax conflicts with the jquery mobile framework. Because my Ajax call etc only works the second time I load my page?
Any idea's of how to solve this annoying problem?
Thanks in advance
One of my pages has about 5 jQuery AJAX calls that fire off as soon as the page loads. I want to track each AJAX call individually and get it an id. How do I do this?
Download the Firefox browser and install the Firebug extension. That will let you track all the XMLHTTP request information for each request (as well as help you with plenty of other debugging issues).
Here's a basic overview: http://getfirebug.com/network
Community -
I'm stuck for couple days on this and decide to go with a iFrame solution and a regular embedded page with a basic reCaptcha plugin using a Page.IsValid {} on the server functionality.
Basiccaly I have an older WebForm ASP.NET 2.0 clients website with a Modal Dialog implemented using a Ajax/JSON call to a MailSend WebService and now integrating a clients wish having a reCaptcha functionality within the modal dialog gets a pain.
After several trials with some basic code and all over not completed code pieces on several blogs around the net I do give up - I go to create a separate page with a regular send to friend mail form and will call it from the parent page with jQuery in a iFrame.
Did anyone had some more luck consuming a reCaptcha Validate Web Service within a modal dialog without a Postback or without using the iFrame way?
I'm thankful for any idea.
Martin
Allright. Me and my co-worker gave up on validate re-captcha thru web service. We finished the task with a iFrame and a jQuery FancyBox modal dialog solution. It solved our problem and it looks good. But I will come back to do the research and try the first way to solve as well at a later point.
I'm writing a simple chat module that will be embedded in a website. It will allow website visitors to chat with the website owner.
The website is ruby/rails and I'm using AJAX.
One thing I can't figure out how to do is how to play a 'bling' sound when a new message arrives (don't worry, this sound is switchable, and the default is 'off'.)
I want the "bling" to play when the message arrives... i.e., when the div that holds the message list is updated by the Server via Ajax.
I'm thinking I need an Event.observe('myDiv', someEvent, callback) function, but I can't figure out what I should use for 'someEvent'...
Any help, much appreciated.
-- John
have you tried 'load' or 'change'? for listeners the event has to be of a certain type described here http://www.w3.org/TR/DOM-Level-2-Events/events.html
another option would be to attach the sound to the AJAX callback function which populates the div.
hope that helps,
Josh