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 have been searching across the Web to find a solution to this:
Basically what I want to setup is a way to have an HTML page on a live production site to kept updated. This is because I have setup a SilverStripe Application as part of a graphics system (green chroma key) that runs through normal HTML.
AJAX load doesn't seem to be an option here since the load would be every 1 second or half a second to make sure the page is live.
I looked into web socket quite vaguely but the whole concept of integrating it with my project confused me entirely.
Anyone got any ideas of what could be done?
To do this you'll need a combination of:
AJAX, you'll need to never do a full page load after the initial Web 1.0 request.
Session history management, you'll need this in order to not break the browser navigation (e.g. back/forward buttons).
Web Sockets, you'll need this so when new content arrives on the server it is received by the client without first having to poll the server.
Web sockets will be the greatest challenge. I listed them in the order in which you should approach the project, in three phases.
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 6 years ago.
Improve this question
I wrote a small code in c# that reads files from the hard drive and outputs that info to a webpage using asp.net.
Information about those files is being changed in the codebehind.
I managed to create variables to read and display the info on the webpage, but they change only after a refresh. When I used setTimeout it would always read the same variable, leaving me thinking that the codebehind does not get re-executed.
How would it be possible to have them updated live without needing to refresh the entire page?
This is somewhat vague but if you want updates to the values on your page after loading, you'll need to use some javascript to grab new values and then more javascript to update values on your page.
There are some great frameworks out there. Unless you have a lot of front-end logic you need to perform through javascript, I'd keep it as simple as possible and throw jQuery in there for the AJAX calls (fyi, this is not the only solution, there are 10+ different ways to skin this same cat).
If you want a bit more efficiency, you could look into using SignalR - which wraps long polling or web sockets (depending on browser capability) on the front end and signals those subscribing pages on the backend only when changes have occurred to data.
Link: http://www.asp.net/signalr
There is no "right" answer to your question so the best I or anybody can do is guide you in a direction. Hopefully this answer helps you.
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 need to create a page which can be shared across multiple users. Means while doing some stuff on my page, that should be broadcast to all the users who are joining me that time. At the same time they can also do some stuff. Something like web conferencing. I need to either use javascript or C#. Is there any API or javascript plugins or any other libraries that I can use? If there then please tell me. I don't need to share desktop just need to share only one part of a web page or only one section only like you can assume I have a particular division, there I have a canvas. On that canvas, I will type or draw something that should be broadcast to everyone.
SignalR is an open source technology built by two Microsoft employees and leverages C# and JavaScript (there is a jQuery plugin for the script side).
A good example to get you rolling would be ASP.NET MVC 3 Real Time Collaborative Apps with SignalR.
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.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
We're relaunching the landing page of our company (contains an info, jobs, team and help section) and decided we'll no longer maintain a Rails project only for this part of our service and therefore switch to static HTML.
As we want to give our HR and support team the chance to edit the texts (especially in the jobs and help section) without bugging the dev team, we'll get an Angular.js app running on the page and patch in the content using a JSON APi (like the one Wordpress.com offers http://developer.wordpress.com/docs/api/ or we might even use https://www.contentful.com/).
However, as we need our landing page to load really fast (conversion is king), we're thinking of serving the initial part of our landing page as static HTML and gracefully add Angular.js after the user has access to the most important information. We don't care if people with deactivated JS can't use the rest of our page, therefore we'd call this process graceful improvement.
Are there any best practices and/or Angular.js modules out there for achieving what I just described? What's the right terminology for this effect?
P.S.: We'll take care of SEO by rendering the rest of our landing page (team, jobs, etc.) using Phantom.js, therefore SEO is not a topic. It's only about the loading speed of the initial part of our landing page.
You could render the static page (whichever way you want to produce those) and add an event listener after the page is loaded. Then in the event listener, you could leverage angular.bootstrap to start the app manually. That way Angular can take its sweet time about it and not bog down the user.
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
What is the best script to use for showing the current visitors or guests Online?
Thanks!
As #Ryan Smith suggested, this greatly depends on the implementation details of the website. I'm sure that there is a off-the-shelf framework offering a storefront application with all the bells and whistles (such as the types of scripts you are mentioning); however, these can range anywhere from being free and open source, or very expensive.
Implementing a script like this yourself isn't very difficult. Assuming that you're keeping track of the users on the website in some form of data store (typically a backend database) you could do something like this:
When the page loads, fire a JavaScript that makes an Ajax request
Have the page that's the target of the Ajax request select a count of the number of rows in the table storing the active users. Return this result.
When the request completes, have the Ajax callback insert the number into the DOM in whatever place you'd like.
You can set this process to repeat at certain intervals so that the pages containing the script are dynamically updated showing a relatively up to date count of the number of users online.
I think it all depends on how your tracking who's online within your application.
Usually, when someone logs-in, you create a session for them that you could iterate through based on whatever language you are using.
You have to keep in mind that HTTP is a stateless environment, so determining when someone is online is largely subjective as to your opinion as to how long ago they logged in.