I want to listen to changes on the server and update my web page accordingly. How can I do this with Javascript? [closed] - javascript

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I am building a web page that pulls data from a server and displays it. The data can change and I want to be able to change the data on the webpage without refreshing the page and not use setInterval. How can I do this with Javascript? Can this be done with Backbone.js?
Thanks

you could use a setInterval that goes to the server and pulls new updates and update the DOM.
If you're using HTML5 then use web sockets which will actually have the server push the updates to the connected client.
If you're writing in .NET then I really really recommend checking out SignalR which will make life easier.

Related

Image processing on browser [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I need to do some image processing on a browser where I upload images and with my python script, it manipulates the images. In the end, I just want to open an HTML page where I can simply use buttons there to process my python script. Please tell me how can I do it? I don't know much about web development. I don't need to host a website. I just want to do it locally so that if I give my files to anyone they can access it by just opening the HTML document.
If you want to practice and you need to upload an image and processing in your web app you need to use Phyton(with Django should be more fast to create what you want) and MySQL(or another database) to save the data.

Handling Eventsource using PHP and C# [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I have created a fileWatcher(running as a service) in C# which calls PHP script through URL whenever there is a change in Folder.
I want to load the web page with new data when there is change in file.
I have tried doing this using javascript Eventsource by calling PHP and echoing by C# whenever there is change in file but no luck.
Any suggestions how would I tackle this problem.
I have solved this problem by checking file size every minute and responding to event source. Only overhead is checking file every 1 minute.

Real time notification in PHP [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I am creating a PHP application, where I want one user make a database entry. It should be reflected to all the users whoever have this app open on their browser will get instant notification that some data has been updated on the database or with whatever data has been inserted.
Is there any way I can get real time notification of data inserted or updated? On all the opened browser without any delay.
We use AJAX for now. But it seems like our application is now working slow due to continues request. Any other way? Which is free.
Thank you!
Take a look at Pusher (https://pusher.com/). It does what you want to achieve and it works like a charm.
I don't know what do you use on your server side but even if it isn't Laravel, take a look at Jeffrey's Laracast about implementing real time notifications in Laravel (PHP). https://laracasts.com/lessons/pusher-awesomeness
Have a fun! When I did it, my app became extremely sexy. Real time notifications, DOM manipulations etc.
You can use web sockets. One existing library example for PHP is Ratchet.

Reload page if Database changes [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I can't set a javascript timer to reload the page every X seconds. It must be a perfect loop with no wait times.
I can't use AJAX. When the database changes a full screen video must be played, and there's no way I can load an "auto-fullscreen" HTML5 video from AJAX method through someotherfile.php
I spent 6 hours today trying to find a way to do this. Apparently I can't put PHP in a loop to 'listen' by doing sql queries every now and on. Weak language I guess.
It has nothing in common with PHP weaknesses it's about server side and client side.
Answering your question. You should try using HTML5 server sent events check these links it should clarify you how to do it. There are examples given:
http://www.w3schools.com/html/html5_serversentevents.asp
https://developer.mozilla.org/en-US/docs/Server-sent_events/Using_server-sent_events
BTW you don't need reload page with JavaScript just simple meta referesh does this.
Note: using EventSource is not supported by all browsers.

Javascript + PHP timed actions [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Here is my goal:
Create some JavaScript action (some function call) that will be timed perfectly between two different clients.
Explanation:
I want a function to be called exactly on the same millisecond on two different browsers/computers no matter when the client accessed the web page.
I thought about creating a time base using the server time but im not sure this will work.
I think you should be using something Node.JS or APE (Ajax Push Engine) to achieve this.
so you want to do like this scenario: user come visit your webpage and he has to wait few seconds that page is shown?
This is useless to do in my opinion, unless you want to flood server with tons of requests..

Categories

Resources