Like so many lost souls in front of me, I'm floundering in a snake hole, which is submitting an Ajax form and caching the IE browser.
I am trying to write a simple script using the jQuery Form plugin for Ajaxify Wordpress comments. It works fine in Firefox, Chrome, Safari, etc. al., But in IE the response text is cached with a result that Ajax causes an incorrect comment.
jQuery(this).ajaxSubmit({
success:
function(data) {
var response = $("<ol>"+data+"</ol>");
response.find('.commentlist li:last').hide().appendTo(jQuery('.commentlist')).slideDown('slow');
}
});
ajaxSubmit sends a comment to wp-comments-post.php, which explicitly spits out the entire page as an answer. Therefore, despite the fact that it is ugly, like toads, I stick to the text of the answer in a variable, using: the latter to isolate the last comment and sweep it in its place.
IE, however, returns a cached version of the page that does not include a new comment. Therefore, ".commentlist li: last" selects the previous comment, a duplicate of which then glides uselessly down below the original.
I tried to set "cache: false" in the ajaxSubmit options, but this does not affect. I tried setting the url parameter and binding it to a random number or timestamp, but it joins the POST, which sends a comment to the server, and not the GET, which returns a response, and therefore has no effect. I'm not sure what else to try. Everything works fine in IE if I turn off browser caching, but this is obviously not what I can expect when anyone views a page.
Any help would be greatly appreciated. Thanks in advance!
. PHP , . , wp-comments-post , , , - post Wordpress, - , .
php - "if is_ajax" - - pageloads, , Ajax GET?