Ajax ::prevent Caching Of The File Loaded
Feb 7, 2009The 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 RepliesThe 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 RepliesI'm currently using this method to refer to my JavaScript files:
<script type="text/javascript" src="filename.js"></script>
While doing work for some clients I have made changes to the the JavaScript file referenced above. Because their browser has cached it, they end up getting errors on the page unless they hard refresh and get the new version of the file.
Is there anyway to make the JavaScript file come down fresh if it has been modified since the last download?
I am attempting to do two things and I'm missing a vital element: ajax call to an XML file to be inserted onto a page, FOLLOWED by selecting these newly created elements to apply event handlers on them. I am near certain that the problem is that the selectors are not 'seeing' these elments and it's an issue of running the event handler only AFTER these elements have been loaded.
How do you do this? I already have a $(document).ready(function() { in order which I naively thought would take care of this exact issue...
I had an incident in which I uploaded a swf file with an incorrect URL. Well, when I noticed the issue I uploaded a 'new' file - but those who have previously seen the site kept seeing this "older .swf".Without a huge proces. renaming files, modifying html files etc.. Is there a way to customize a meta tag or some other mechanism to have a '.swf' file NOT CACHE. It has to not cache in all browsers.. ala: ie, ff, safari
View 2 Replies View RelatedI have a page which embeds an iframe like so:
<iframe src="" id="test"></iframe>
somewhere in my JavaScript code in the page, I set the src attribute of the ifrmae. This causes the iframe to load the page as it should.
If I leave this page to another and click 'back' in the browser, I return to my page, and the iframe gets loaded automatically, using the last src value it had.
I don't want that. I only want the iframe to load when my JavaScript code modifies the src attribute.
It is as if the browser remembers in its cache the last value of the iframe src.
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 RelatedI'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>
I'm trying to use cluetip jquery plugin inside a message_container div which will be updated once in a while through ajax. The plugin works just fine in any other div, but it seems that in message_container div the already loaded external javascripts are not present ie the plugin doesn't work. Do you have any ideas what would be a proper solution for this issue?
View 1 Replies View RelatedI'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]...
I'm creating an AJAX page that is built using a PHP Class, ie the php looks a bit like this: PHP Code:
$wp_page->addjs('../var/savepolicies.js')
$wp_parser->page = "userpolicywindow.php";
$wp_parser->addlink("Home","../index.php","");
$wp_parser->addlink("Logout","javascript:logout();","");
$wp_parser->getpageid("501");
[Code]...
within this page that has been created, there is an AJAX tree folder which calls another page to be loaded into a DIV by AJAX again. Code:
[Code]...
I don't know why it doesn't work because the page has been loaded with the JS file, but as soon as the link is added afterwards it doesn't work. I take it this is because it doesn't know where to find the JS, but how can I overcome this?
My swf.js file is getting hacked along with some jquery files, they are injecting cross browser hacking script to .js files.
View 2 Replies View RelatedAssume we have one button that fires ajax request, ajax call will talk 15 seconds to load the results. Assume the user clicked on that button first time and waited for 5 seconds, then he/she clicked again. In this case the page will be loaded two times. i.e. first time will be loaded and after finishing the first ajax request, the second one will start!
Is there any way to cancel the second ajax request(both first and second ajax calls come from first button) while having the first one in process? The problem, if the user clicks more than one time on the same button, then a queue of ajax calls will be executed and the user will wait for long to process all of them. So I need to cancel similar requests that come after first request.
i can't figure this out, it was working fine before, and i did a few updates and now it only works when the button is pressed but not if i type into the form and press 'enter'. i don't want he page to reload at all. (also the entire wrapper for my page is hidden using css, a loading image is displayed until the onload event fires, then the wrapper uses jQuery's .slideDown(2000), so if javascript is off they won't even see the form, i'm not concerned about browsers with javascript disabled, i *only* want them to be able to type in the field and hit enter or click the send button to post the data via ajax with no page reload. i'll make it more accessible later)
[Code]...
I am developing a web application in which user can change the theme of the page.
So for this i am changing href attribute of the link tag on selection of the perticular theme.
Problem is that when i change the theme whole page gets messed up till the new css fileis fully loaded.
So how can I check if the CSS file is completely loaded or not?
I have searhed all the web about this Question I hope I can find the answer here.
I have loaded external file js into html page :
<table><tr><td id=x>
<script language=JavaScript src = first.js></script>
</table></tr></td>
NOW :
I need to click on a button or a link to load the external second.js instead of the old one first.js
I don't want to use any iframes...
Any idea how to load external js files in <td> tags or any other place in html page.?:rolleyes:
I have my site all set up with a horizontal accordion menu and a content area into which I load a DIV via jQuery from an external php-file.
Let's say I have the content of one category loaded and I offer two links to switch between subcategories. Now of course I could simply have the content in different DIVs - both loaded and only one at a time visible and toggle. But the markup is always the same, only the text in different. So I would prefer not to repeat the markup and instead define the text through a php-variable and an if-else-construction. To achieve a result, I would need to reload (or rather reparse) the already loaded php-file with the new condition when clicking on the subcategory.
Is there a way to "unload" the ajax-loaded file or reload it? I tried simply loading it again and also removing the DIV before that. But it didn't work. Also now not solely the DIV is loaded but the whole page reloaded. Neither
Code JavaScript:
Nor
Code JavaScript:
would do it.
I have been mostly working with php and prefer it in these cases also in terms of progressive enhancement.
Code JavaScript:
PHP Code:
If you check this page Targeted fitness training for body and mind, the swf file is not being loaded. I just see a spinning graphic.
View 1 Replies View RelatedI have an XML file that I'm trying to load into and xml object, however the doctype tag is killing the javascript, and does not parse the XML at all. If I remove the doctype, the javascript can parse, and I can access the XML DOM. So I know the XML is valid. Even with the Doctype, it validates. However Javascript does not like it. I don't have a choice to remove the Doctype tag of the XML.
If I remove the Doctype, this method works to parse the XML DOM:
Code:
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async = false;
xmlDoc.load(filename);
Also, if I use the .open method to retrieve the XML, I cannot access the XML DOM via xmlhttp.responseXML. But I do get a result when I use xmlhttp.responseText, it displays the corresponding XML.
Code:
xmlhttp.open("GET", filename, false);
I have a php page its only work is to display a swf file and after a period of time it redirect automatically to another page. The problem is when the php page loads the swf plays slowly.
What I nead the php file is to wait untill the swf file is fully loaded then play it so it will be played normally in normal speed?
I'm using ajax to store values from a form into MySQL. The form contains a text field named "title" and the method I'm using to fetch and pass on the data to the backend is shown below:
_data = "title=" + $( '#title' ).val();
$.ajax({
async: true,
type: "POST",
url: "backend.php",
dataType: "json",
data: _data,
success: function( json ) { .... }
}});
The method works fine for normal text, say "This is a sample text". However, if an ampersand is used in the title text (example: "This & That"), the post value is being truncated at the ampersand. In effect, the & in it is causing the string to be split up into two segments and the
part after the & is being treated as a variable,
i.e. instead of passing
title = This & That
What is being passed is,
title = This
That =
* as shown by Firebug
I'm loading a (HTML) list from mySql via PHP into a main page using load. The main page is linked to a css file and a js file (jquery). The loaded data assigns the css file BUT does not seem to be able to find the js file as the click handlers in that file do not work. I'm new at this and this is probably a BASIC issue.
View 2 Replies View RelatedI am working on a project that relies heavily on AJAX calls, they are done in dozens of places. There are a number of places where I would want to prevent the user from submitting information multiple times (form submissions etc ). I am trying to think of the best way to accomplish this.
I could simply disable the element that starts the AJAX call upon the first click and re-enable it upon completion of the call. I have also seen examples of developers using a class to handle ajax calls that store an identifier for the call and if it is in progress any new calls with the same identifier will be ignored.
I'm creating a site that uses AJAX to create a "page flipping" type effect. So it works kind of like an FRAME, where when links, etc. are clicked just the main content area is reloaded using JQuery AJAX.
The problem is that that content seems not to pick up the CSS stylesheet rules. I have to press refresh before it loads the styles.
How can I refer to inputs ina a page loaded by ajax in a div from parent and vice versa?
I already tred parent.form.element and also opener.form.element with no luck..
I have a script that takes longer to load than the page, so I would like to have it say "Loading - please wait!" until the script has loaded. I don't want it to hide the entire page - just this one script.Up until recently, I had no idea as to what ajax was, or what it did, so I surely am unable to do this.
View 3 Replies View RelatedI need to be able to use jQuery's load function to grab the contents of an external file and append them to a particular DOM element. The problem is that when that external file includes scripts that contain calls to document.write, I get weird behavior that changes depending on which browser I'm using.If I'm using Internet Explorer, the load function gets all of the non-script elements from the external page and correctly appends them into the DOM element. Of course, this is not ideal because it ignores the scripts.If I'm using Firefox or Safari, the load function runs the scripts but the document.write output overrides the entirety of the calling page.Thus, I end up with a page that now only contains the document.write output instead of a page that includes the original HTML plus the document.write output as a child of a DOM element.
View 4 Replies View Related