Ajax :: How To Stop Browser From Caching Dynamic HTML
May 12, 2010
I'm not having this issue with Mozilla Firefox, but it seems that the results of the code below are being cached in EI 8. When the browser makes another asynchronous call to the server with different results from the database, those results are not being displaying on the wepage. How do I fix this problem. As I mentioned above the code works fine in Mozilla Firefox. The page displays data in EI 8 with no errors five seconds after the page has loaded, but as the information in the database changes, I'm not seeing those changes reflected on the page in 5 second intervals.
<html>
<head>
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script>
$(document).ready(
function() {
setInterval ( "reload1()", 5000 );
});
function reload2(){
$.get(
'vcci.php',
function($xml) {
// Make the XML query-able with jQuery
$xml = $($xml);
var $iso2 = $xml.find('data').text();
//alert($iso2);
$('#para').text($iso2);
},
'xml'
);}
</script>
</head>
<body>
<p id="para"></p>
</body></html>
View 1 Replies
ADVERTISEMENT
May 12, 2010
I'm not having this issue with Mozilla Firefox, but it seems that the results of the code below are being cached in EI 8. When the browser makes another asynchronous call to the server with different results from the database, those results are not being displaying on the wepage. How do I fix this problem. As I mentioned above the code works fine in Mozilla Firefox. The page displays data in EI 8 with no errors five seconds after the page has loaded, but as the information in the database changes, I'm not seeing those changes reflected on the page in 5 second intervals. I'm assuming this is a caching issue, if so how do I fix it.
[Code]...
View 1 Replies
View Related
Sep 1, 2011
I run a webcam streaming site, and has a gallery of images saved every hour every 24 hours, the thumbnails dont seem to change much (?) so wondered if there was a way to stop caching using a javascript . . . script? This is what im dealing with:
<!-- timeshots -->
<div id="Html4" style="position:absolute;overflow:auto;left:286px;top:557px;width:455px;height:180px;z-index:10">
<a href="[URL]" rel="lightbox" title="GardenCam at 12:00am"><img src="[URL]" /></a>
<a href="[URL]" rel="lightbox" title="GardenCam at 1:00am"><img src="[URL]" /></a>
<a href="[URL]" rel="lightbox" title="GardenCam at 2:00am"><img src="[URL]" /></a> .....
View 5 Replies
View Related
Sep 13, 2009
I've noticed that when I click the Stop button on the browser, or navigate to another page, jQuery.ajax calls the error event. You can see the problem live at: [URL]..
[Code]...
View 3 Replies
View Related
Jul 23, 2005
I am brand-new to javascript, but after reading some tutorials online I
was able to make a dynamic HTML photo gallery in javascript. It works
fine in all browsers except IE6 (big surprise). I've been looking
around online for solutions, but the fixes I have seen don't seem to
work. I assume I am misunderstanding something... I was using
element.setAttribute but have changed my code to avoid that. Here is an
example. IE6 displays the link text but doesn't do anything else--exact
same result I had by using element.setAttribute('name', 'value').
View 3 Replies
View Related
Jul 23, 2005
We have a dynamically created javascript menu (from ASP), which is
customised per user (Have already taken all the static code out into
separate cached .js file)
The size of the 'dynamic' menu content can be as much as 10kB, and the
menu typically does not change for the duration of the user's session
- i.e. it would be nice to get the browser to 'cache' this. It is an
Intranet application, and is typically aimed at IE6 clients only.
Have considered the following strategies
1) Cookies - although the last thing I want is the whole menu coming
back to the server on every HTTP request - but would be useful IF
there is e.g. a header option the cookie to 'send' the cookie (Server
-> Browser) without the browser ever sending it back to the server
(but the browser still being able to 'read' the cookie?)
2) Creating 'dynamic' javascript files - i.e. send the output per user
to a mangled .js file (e.g. with a session ID in the filename), into a
cached js file. Would however need to cleanup the files quite
regularly, and giving IUSR file creation access doesn't seem a good
idea. Would then get the browser to include the JS by generating ASP
along the lines of.
<script language="JavaScript"
src="TempScripts/Menu<%=UserSession%>.js"></script>
Is there any other way?
Second Question : Is there any way to get IE to stop sending up the
HTTP REFERER header up to the server (e.g. RegKey) - this is pretty
pointless on an Intranet App (I know there is a way to do in
NetScape).
View 5 Replies
View Related
Jul 29, 2010
I have a textarea element, and a link action to empty the textarea.
$('.area').empty();
Normally it works fine. But after a ajax call to send the textarea value, the empty() stops working. I also tried text(), html(), none of them are working. The original text in the textarea still stays there. I have no way changing its value. My guess is firefox caches it or something.
View 10 Replies
View Related
May 14, 2009
It looks like IE is caching the response for some AJAX requests here. The app I'm working on is a catalog of sorts. Clicking the link for a category loads a set of "items". Those, in turn, may be deleted from the admin view. The delete works fine (I checked the DB) but, when loading the same set of category items, I'm seeing the list unchanged. That is, the thing that was deleted is still there. Sorry for the crap explanation but I'm not really sure of a better way of putting it. Bottom line is, has anyone seen this sort of behavior with IE before? Can it cache the result of an AJAX request like that? And, if so, how can I guard against that? Can I set cache-control headers for an AJAX request?
View 2 Replies
View Related
Feb 7, 2009
The loaded file normally, an hrml file, they have no scripting code which can't prevent caching. So how can I do so with this kind of file ?
View 4 Replies
View Related
Jul 20, 2005
Anyone know how to hook a browser's Stop button (event?) in JS? I've
looked through the Document and Window DOM events in my O'Reilly JS
book and don't see anything that stands out. About the closest thing
I've come across is onAbort() in the Image object... I just want to
know if Stop was clicked and if so redirect using parent.location.
View 1 Replies
View Related
Apr 1, 2010
I'm having trouble using the stop() function. I'm trying to make a dynamic menu using jquery library. This menu is now working pretty correctly but I can't manage the problem of multiple queued animations. My menu is made in two parts. The first one contains buttons. When they're hovered over, the second level of the menu appears just underneath. But when several buttons of the first menu are hovered over, I can't stop the second level to appear and disappear anarchically. Here is an example of code of the second menu :
<div class ="menu_deroulant">
<!-- ######## Menu Déroulant niveau 1
|| Accueil ####### !-->
<div id ="menu_deroulant_accueil">
<div class
="nom_speedbarre"
>Accueil</div>
<ul>
<li ><a href="***.php" .....
View 2 Replies
View Related
Jul 4, 2009
I'm completely new to jquery and javascript and am just trying to get a simple script up and running. I've put this in the head of the document:
[Code]...
with a div with an id of "togglecontent" and a link with an id of "fadein" in the body about halfway down the page. The toggle works well, but when you click on the link, as well as "togglecontent" becoming visible, the browser window jumps to the top of the page, which obscures some of the toggled div. Is there any way I can stop this from happening?
View 3 Replies
View Related
Sep 16, 2007
I'm not having any luck with stopping an Ajax.PeriodicalUpdater function, Prototype 1.5.0. My function looks like this and I call it on window.onload:
function fileuploadStatus() {var u = new Ajax.PeriodicalUpdater(
'statusDisplay',
'returnStatus.lasso', {
method: 'get',
parameters: 'fw_s=sid',
frequency: 2
}
);}
Code:
View 2 Replies
View Related
Aug 17, 2010
i've got an html page which near the end of it has a particular image (a normal html <img src... one). is there any javascript way to stop browsers accessing that image from the server before it attempts to do so?
View 6 Replies
View Related
Jul 23, 2005
Why does the following form validation not work?
If both CityTown and County fields are blank then the html should stop and[url]...
View 3 Replies
View Related
Mar 30, 2010
I am trying to find the simplest, most cross-browser friendly dynamic navigation for my site. I tried to use a CSS version (Suckerfish) and it worked ok but it destroyed the formatting I had. I would really like to implement this kind of dropdown on my main navigation so users don't have to click and wait for a page to load. If possible, I'd like very few lines of code. That's why the CSS option was good... there was very little javascript.
View 7 Replies
View Related
Aug 6, 2010
I'm writing php based website that queries a database and writes the html with the results. On the home page, I am querying one database and receiving data to connect to other databases (i.e., database hostname, username, and password). Depending on the link selected, the homepage creates a dynamic form and sends the data via method=post. The next dynamic webpage receives the data via $_POST and connects to a different database for the rest of the website content.
I can successfully select a link on the home page and load the data for the second page the first time, but I have a problem when I hit back on the browser. The browser takes me back to the home page but if I select another link for another database, it does not "post" the new database info and the second page looks the same as the first time it loaded.
Here is my code
Code:
function database(project, hostname, username, password) {document.body.innerHTML += '
<form id="databaseform" action="project.php" method="post"><input type="hidden" name="project" value="' + project + '">
<input type="hidden" name="dbhostname" value="' + hostname + '">
<input type="hidden" name="dbusername" value="' + username + '">
<input type="hidden" name="dbpassword" value="' + password + '">
<input type="hidden" name="dbpassword" value="' + password + '"></form>';document.getElementById("databaseform").submit();}
View 5 Replies
View Related
Oct 9, 2009
I'm building a slide show using jQuery and I am having sporadic issues displaying an image before it's fully loaded. e.g. Images are stored in a database (binary not the image path) and I use an image handler to retrieve the images. Because the amount of images for each slide show is not predetermined, I load the first image and next image initially, then each time a slide (next) is selected I fetch that slide and the next slide. I don't want to pre-load each image as there could be well over 50-60 images and some users might only view a handful of slides. Thus wasting bandwidth and resources. Is there a way I can tell when the requested image is ready to be viewed/rendered? The reason for this is that all images are not fixed width/height and to place them in the middle of the "stage" I need to check the height/width so I can add it to the container I am positioning.
View 1 Replies
View Related
Mar 29, 2011
I've got a script that reads a line of text from a file, and does a bit of parsing to that line into an array. Apparently, this can take some time, so I get the "Stop running this script?" message.From what I understand, I need to use the setTimeout call, but for the life of me can't understand it. When I do add it to some code, it seems to work, but doesn't "pause" the code as I expect it too...
function ReadFile(Fname)
{
var path = "y:\metrics\";
[code]....
View 6 Replies
View Related
Aug 10, 2010
I should preface this by saying that this is not for my own site, or my own code; a friend has gone on holiday and needed this project fixing while he was away. Unfortunately my experience with jQuery is almost nil and everything was coded by someone else, so I'm really tearing my hair out. This is a Wordpress installation running Thematic with two child themes, one of which uses Ajax calls to grab page content. The issue is that the Ajaxified calls stop the swfObject content from being loaded. Compare:
[Code]....
View 2 Replies
View Related
Jul 23, 2010
I tried to add links to open local xml files in browser in a dynamic table cells. I need help. I tried all ways but I think I miss something.I can open them without table just by document.write(xmlfile location).
function showResultsTable(searched, srchedname) {
// get the reference for the body
var mybody = document.getElementsByTagName("body")[0];
[code]....
View 7 Replies
View Related
Aug 24, 2009
In page load of an asp.net, I am creating some dynamic checkboxes. How can I use the javascript to refresh these checkboxes without loading the whole page?
View 7 Replies
View Related
Jul 23, 2010
I tried to add links to open local xml files in browser in a dynamic table cells. I tried all ways but I think I miss something. I can open them without table just by document.write(xmlfile location).
Here is my code.
function showResultsTable(searched, srchedname) {
// get the reference for the body
var mybody = document.getElementsByTagName("body")[0];
// creates a <table> element and a <tbody> element
mytable = document.createElement("table");
mytable.setAttribute('id', 'resulttable');
mytablebody = document.createElement("tbody");
// creating all cells
var mycurrent_cell = new Array();
for(var j = 0; j < srchedname.length; j++) {
// creates a <tr> element
mycurrent_row = document.createElement("tr");
mycurrent_cell[0] = document.createElement("td");
currenttext = document.createTextNode(j);
mycurrent_cell[0].appendChild(currenttext);
mycurrent_row.appendChild(mycurrent_cell[0]);
mycurrent_cell[1] = document.createElement("td");
link = document.createElement("a");
link.name = ""+srchedname[j]);
link.href = "C:\AAA\TestCasesList.xml";
mycurrent_cell[1].appendChild(link);
mycurrent_row.appendChild(mycurrent_cell[1]);
mycurrent_cell[2] = document.createElement("td");
currenttext = document.createTextNode(searched[j]);
mycurrent_cell[2].appendChild(currenttext);
mycurrent_row.appendChild(mycurrent_cell[2]);
// appends the row <tr> into <tbody>
mytablebody.appendChild(mycurrent_row);
}
// appends <tbody> into <table>
mytable.appendChild(mytablebody);
// appends <table> into <body>
mybody.appendChild(mytable);
// sets the border attribute of mytable to 2;
mytable.setAttribute("border", "2");
}
View 2 Replies
View Related
Jul 11, 2011
not sure what section to post this in, basically i have html in a javascript function that i want to pass into a php.
here is some of my javascript code
var names = document.getElementById('names').value;
var nms = names.split(";;")
for (i=0; i<las.length; i++)
[Code]....
basically i want to be able to access the value of nms[i] in the php call. i am able to pass anything in <input> tags like normal html, but i want to get nms[i] to go through
View 1 Replies
View Related
Dec 27, 2010
I am writing a javascript method to add/remove HTML elements using Javascript.
I use cloneNode to clone the element.
Following is the code
Code:
<HTML>
<HEAD>
<TITLE>Dynamically add Textbox, Radio, Button in html Form using JavaScript</TITLE>
<SCRIPT language="javascript">
[Code].....
View 4 Replies
View Related
Jul 23, 2005
If I use javascript to 'read' and XML file does that mean that the XML
file gets downloaded to the user's cache?
I'm building a quiz and I'd rather not have the answers too easily
available. I believe there's no real way to secure anything client side
with javascript so I'm just trying to keep the curious at bay.
View 3 Replies
View Related