Is there any way to create AJAX between tabs of the same browser of tabs of different browsers?
-
This is a hard mission, I know, but one day we will need it. For example, on Quora. I have 100 Credits to Promote. I use them. And all the other previous opened pages show me that I still have 100 Credits to Promote, NO I DON'T!!! I spent them some seconds ago. That's an AJAX that I want for Quora... I don't know. AJAX is a method so it should call through the browser, to access the other tabs.
-
Answer:
The answer by is most correct here. The reason why the "number of credits" entries on pages don't update is that Quora doesn't have a "credits spent" event that gets posted to all open tabs that adjusts the number of credits displayed, similar to the way it has a "notification" event that adjusts the number of notifications displayed in the header. (For one thing, not all pages rely on your credit total, so having an event like that would only add overhead with less utility than the "notification" event.) You may have mistaken the purpose of AJAX. AJAX technology (the term is an acronym for "Asynchronous JavaScript and XML") allows JavaScript code running in a browser page to compose new requests to the server and submit them "in the background" asynchronously. It has nothing to do with communication between tabs in a browser, although such communication can be facilitated by using AJAX. Hat tip: for the A2A.
Eric Bowersox at Quora Visit the source
Other answers
Interestingly enough: if you get a new notification on Quora while it runs in multiple tabs, it is shown in all tabs. It's magic, right? :) I wouldn't mess with crosstab coding, because that's very unreliable. The way most websites do it is: You perform an action that triggers a change (i.e.: you spend credits) This change is stored in your profile in the database There are listeners on all Quora-pages that check for updates, and change the values on the site accordingly. So all you do is store your change in one central location (the database), and then have your website automatically update the page every now and then. Facebook works that way too, by the way.
Geoffrey Reemer
I think Quora uses a timeout to check with their servers every so often. Under normal circumstances, tabs are completely separate for security reasons - unless you opened a new tab through JavaScript (window.open) and gave it a unique name. Then you can influence it.
Richard Lund
There are many ways to communicate between two tabs or windows . most of the time cookies , localstorage are used as you mentioned in comments cookies are the thing you are looking for i just want to add is : when you communicate with cookies , set its path and domain property to same values so that different tabs able to communicate it , other wise it won't be able to.. these links will helpfull on communicating with cookies and localstorage http://stackoverflow.com/questions/4079280/javascript-communication-between-browser-tabs-windows http://stackoverflow.com/questions/4167965/how-do-you-communicate-between-2-browser-tabs-windows
Vishal R Sharma
Related Q & A:
- How to create a generic View for different Models?Best solution by Stack Overflow
- Is there a way to preset several tabs in the browser that open automatically?Best solution by answers.yahoo.com
- How do I restore the tabs in my Internet Explorer browser window?Best solution by Yahoo! Answers
- How to add self-signed certificates to different browsers?Best solution by Super User
- How do I create custom tabs on Facebook?Best solution by eHow old
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.