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..
Related
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.
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 6 years ago.
Improve this question
I tried using java script but it didn't work. I also tried php imagegrabscreen() but it demands URL whereas I have a customer's page URL different for everyone ex: /member.php?email=shady#gmail.com&code=A101_123 .
Basically I want to store user's screenshot so he can be able to see those images of his activity. So any solution?
I would recomment to take a look at html2canvas. It is a JavaScript solution that works on the client side. Only problem: It takes the current DOM from the user and builds a picture with the browser engine. So it is not 100% accurate, but pretty close.
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'm new to PHP, and I'm trying to achieve this:
The problem is, I don't even know is it possible using any combination of PHP/Javascript or JQuery. Whenever user is redirected to UI, the function state is lost and cannot be resumed from where it left, after the successful completion of UI tasks.
Is there any possible solution to achieve this? I know I can create a new method and call that after user clicks OK. But my requirement is to not breakdown the function in further modules.
Thanks in advance.
No, PHP is a scripting language: script runs, does something and dies. And so on every request. Make your code stateless, we have files and DBs and other storages for state.
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.
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.