I switched the $.post to $.get and it worked much much better!
On 7 Sep, 15:31, nubcake <unniw...@gmail.com> wrote: > Heya! > > The "In IE I need to wait 5-6 seconds" means that in IE I need to wait > 5-6 seconds after I have made my first selection in the drop-down > menu, if I change too quick it doesn't send the query to query.php. > So pressing keyup/keydown in IE doesn't work unless I wait 5-6 seconds > on each 'selection', while in FF/Chrome I can jump between them as > fast as I like. > > Removing the keyup-event didn't make any difference to the behavior in > IE. > > On 3 Sep, 21:36, James <james.gp....@gmail.com> wrote: > > > Hmm.. It looks okay to me. > > Could you define "In IE I need to wait 5-6 seconds" a little more? > > Does that mean you have wait for the page to finish loading, then wait > > 5-6 seconds, then do any drop-down selection? > > Or does it mean you do a drop-down selection, then wait 5-6 seconds > > (with a setTimeout or something) before the AJAX call? > > > Also, what happens if you remove the 'keyup' event and try it? Just > > 'change' should be sufficient, I think. > > > On Sep 2, 10:45 pm, nubcake <unniw...@gmail.com> wrote: > > > > Hello! > > > > I've having troubles in Internet Explorer with AJAX-queries using > > > jQuery. > > > When I change 'option', located in the below code, in FF/Chrome the > > > $.post is sent almost instantly. > > > In IE I need to wait 5-6 seconds otherwise the $.post will not be sent > > > to query.php. > > > > Is there any solution to this? I've experienced it in both IE7 and > > > IE8. > > > > <script type="text/javascript"> > > > function shopQuery() { > > > var countrycode = $("#shopcountry").val(); > > > if (countrycode !== "") { > > > $.post("query.php", { queryString: ""+countrycode+"" }, function > > > (data) { > > > $("#shopbrand").html(data); > > > $("#shopbrand").show(); > > > }); > > > } else { > > > $("#shopbrand").hide(); > > > } > > > > } > > > > $(document).ready(function(){ > > > $("#shopbrand").hide(); > > > > $("#shopcountry").keyup(function() { > > > shopQuery(); > > > }); > > > > $("#shopcountry").change(function() { > > > shopQuery(); > > > }); > > > > }); > > > > </script> > > > > <div class="container"> > > > > <label for="shopcountry"> > > > <span class="label">Country:</span> > > > <select id="shopcountry" name="shopcountry"> > > > <option value="">Choose a country</option> > > > <?php > > > while ($row = mysql_fetch_array($countries)) { > > > echo "<option value=\"".$row['countrycode']."\">".$row > > > ['country']."</option>\n"; > > > } > > > ?> > > > </select> > > > </label> > > > > <div id="shopbrand" style="border:1px solid black;"> > > > </div> > > > > </div> > > > > Do you have any ideas what's going wrong?