How to share data between two browser windows - ajax

In my web application I get some data from server. Then if user want's to see this data visualized in great detail I want to open second browser window and do it there. The problem is with passing the data to be visualized. I don't want to make second request to server. So all I have now is to append this data to the URL to be opened in second window. This of course works but the URL look ugly and the amount of data is very limited. Is there any other way to accomplish this?

You could use a session-value. Save the data into the session when retrieving it from the server, and read it when you open the second browser tab.

Related

Access to other control values when AjaxFileUpload fires UploadComplete event

My understanding is that the AjaxFileUpload object uses an iframe to upload files. A postback occurs, but no other controls are posting back - at least that is what it looks like to me as I cannot access any other controls' data.
The purpose of the app is to allow the user to upload a file. It will then modify the contents of that file and save the results to the server. The problem is that it needs some extra information to make the modifications, and therefor needs the information that the user entered elsewhere on the page.
The only solution I have been able to come up with is to do a postback every time one of those other controls is modified, which affects the apps responsiveness. I have been looking for a couple of days for another solution.
Does anyone have any ideas? The best case solution would allow me to access all of the data I need when the AjaxFileUpload control does a postback.
you could have a ajax function that is reading changes from time to time external data, and update the information displayed, similar to email alerts, sorry for my English.

How image are handle by the browser and how to save them without reloading?

Just to be sure, if you load a page and let's say this page has 3 images. First refere to "/images/1.jpgn", the second to "/images/2.jpg" and the third to "/images/1.jpg" again. When the page sent to the browser, will the browser make a new request to the server and ask for the image? And if the image has already been request (like my "lets say", it has two time the same image) will it request it again or it will know that this image/url has already been loaded and will just retrieve it from the temp?
Which lead to my second question, is there a way to save with javascript/jquery this image on the computer (with the download box opening like if you were downloading a file) from the temp without having to request it again from the server?
I don't know if I am really clear but in short, I want to save an image of the page from the cache and not request a download to the server.
Browsers generally cache what they can, according to what the HTTP response headers say. That is, servers ultimately control what browsers can (or should) cache, so it's server configuration that usually controls such things.
This applies not only to images but all content: HTML pages, CSS, JavaScript, etc.
It is all on how the server sends the image the 1st time (with or without caching).
If you have caching enabled on your browser, the browser will usually check your cache before requesting the file from the server.
The browser should take care of. It won't continually re-request the same file.
Typically, the browser will see that two images have the same source and therefore only download it once.
However if the same image is requested again later, the browser will send an If-Not-Modified-Since header to the server. The server can then respond with 304 Not Modified, at which point the browser uses the local copy to "download instantly".

How do I share data across multiple browser tab or windows?

I m currently building a facebook style notification system for my site.
I m using long polling. So, the server sends data if its available and closes the connection.
Now the problem i m facing is that, i want it to share across all open tabs or windows of that browser.
I m using a cookie to detect if a tab is already executing the ajax call, so other tabs will not execute it until the operation of the first tab is complete.
Now what i want is, to have an effective way, so that i can show the data across all open tabs in the form or a small fb style popup box.
The goal is if the last active ajax call has some data, then a small popup box will show up on all open browser tab or windows.
As, a theory i may be able to do it via cookie, but i want to know if there is some better way to do that.
Thanks,
Anjan
Browsers don't let pages talk to other pages. You'd have to make an extension to get around the cookie.
If you're ok with the cookie idea, follow these examples:
For client side access
For PHP access
For NodeJS

Cache web forms in client side

is it possible to cache form contents on client side? Like maintaining state even if the form is un-saved and the user moves to a new page then returns back to the form?
The best way to do this would be by using Javascript/AJAX to talk to the server, saving each form field as the user went off it. Then, when you load the page, you'd see if there was any content for each form already saved.

Web page expired message in browser

I am implementing a web application using ASP .Net and C#. One of the pages has a requirement that it always needs to be fetched from the server, rather than from the local browser cache. I have been able to achieve this.
We have a back button in the application, which simply invokes javascript:history.back() method. The problem is that when the back button is clicked to navigate to the page which is always to be reloaded from the server, the browser displays a "Web page expired message".
The intent here is to force the browser to reload the page rather than display the web page expired message.
Any help would be highly appreciated. Thanks a ton in advance.
You will probably need to change the implementation to make the browser load the URL explicitly:
window.location.href = 'http://....';
instead of invoking the back button, since the intention of the back button is to get the last page from the cache.
(If browsers would not act that way, they would re-send your form data multiple times when using the back button during a registration process or similar.)
You mean you want to control browser behaviour, which is not possible. I doubt you can solve it that way. You could set the expiration time to a small value (1 minute perhaps?) so that the page is still valid if one navigates back quickly.

Resources