You may need to set cache = false in your ajax call. To do this, you'll
have to use the base $.ajax function rather than $.get, like so:
$.ajax({
cache: false,
success: function() { // callback here },
// other options
});
-- Josh
----- Original Message -----
From: "kwikgoal" <[EMAIL PROTECTED]>
To: "jQuery (English)" <jquery-en@googlegroups.com>
Sent: Thursday, April 17, 2008 11:06 AM
Subject: [jQuery] Quick AJAX question
I have a select box that is loading some data depending on what was
selected. I am just trying to find out why when I use any of the
JQuery get functions, it will run the first time the value is selected
from the select box, but then not run again. It seems to cache the
result of the AJAX call somehow, but this is not what I want to have
happen. If I change the method to a post, it will run every time. Is
there reason for this? It doesn't matter too much as it works with
the post, but I am just curious as to what I may be doing wrong.
$().ready(function() {
$("select#states").change(function()
{
$.get("demo.htm", // target
url
{state:$(this).val()}, // Send
data with comma delmited list of HTTPRequest parameters.
function(respText) // what
will happen when the ajax call completes.
{
$("span#stateResults").html(respText);
});
});
});
Thanks for any info,
~K