[jQuery] Re: AJAX-queries in Internet Explorer
I switched the $.post to $.get and it worked much much better! On 7 Sep, 15:31, nubcake 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 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 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. > > > > > > > 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(); > > > }); > > > > }); > > > > > > > > > > > > > > > Country: > > > > > > Choose a country > > > > > while ($row = mysql_fetch_array($countries)) { > > > echo "".$row > > > ['country']."\n"; > > > } > > > ?> > > > > > > > > > > > > > > > > > > > > > Do you have any ideas what's going wrong?
[jQuery] Re: AJAX-queries in Internet Explorer
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 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 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. > > > > > 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(); > > }); > > > }); > > > > > > > > > > > Country: > > > > Choose a country > > > while ($row = mysql_fetch_array($countries)) { > > echo "".$row > > ['country']."\n"; > > } > > ?> > > > > > > > > > > > > > > > Do you have any ideas what's going wrong?
[jQuery] AJAX-queries in Internet Explorer
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. 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(); }); }); Country: Choose a country ".$row ['country']."\n"; } ?> Do you have any ideas what's going wrong?
[jQuery] Re: Hide/Show when Check Box is selected
Thank you so much, it works like a charm! Best regards. On Feb 26, 3:01 pm, Stephan Veigl wrote: > Hi, > > 1. Hide all your divs. Maybe you could add a distinguishable class to > your hidden divs, this would make the selection more readable and > precise. > > $(".left div").hide(); > > 2. Add a click handler to all your checkboxes. > Get the ID from the value attribute and hide / show the according div. > > $(".left :checkbox").click(function(){ > var id = "#div"+this.value; > if ( this.checked ) > $(id).show(); > else > $(id).hide(); > > }); > > by(e) > Stephan > > 2009/2/26 nubcake : > > > > > Hello again! > > > > > GENERAL > > > > > class="tooltip" href="#">App #1Info > > [SECRET FIELD FOR App #1] > > > class="tooltip" href="#">App #2Info > > [SECRET FIELD FOR App #2] > > . > > > > > > > I'd like to have it so when I click the checkbox for "App #1" only the > > "secret field" for App #1 becomes visable. > > > Thanks for your help! > > > Best regards > > > On Feb 26, 2:18 pm, Stephan Veigl wrote: > >> Hi > > >> the example is working on IDs (see the # in the selector). > >> If you send a HTML snippet of your page, maybe I better understand > >> what you mean. > > >> by(e) > >> Stephan > > >> 2009/2/26 nubcake : > > >> > Hey! > > >> > Is there any simple way to rewrite that so it works on ID:s instead on > >> > class? > >> > I have several checkboxes/"hidden divs", but I only want to "unhide" > >> > the div that belongs to the clicked checkbox. > > >> > Best regards. > > >> > On Feb 18, 5:10 pm, Stephan Veigl wrote: > >> >> Hi Miguel, > > >> >> you can use the click trigger of the checkbox: > > >> >> > >> >> show secret: > >> >> > >> >> secret field: > >> >> > >> >> > > >> >> $("#div").hide(); > > >> >> $("#checkbox").click(function(){ > >> >> if ( this.checked ) { > >> >> $("#div").show(); > >> >> } else { > >> >> $("#div").hide(); > >> >> } > > >> >> }) > > >> >> by(e) > >> >> Stephan > > >> >> 2009/2/18 shapper : > > >> >> > Hello, > > >> >> > On a form how can I Show a fieldset when a checkbox is Selected and > >> >> > Hide the same fieldset when the same checkbox is unselected? > > >> >> > Thanks, > >> >> > Miguel
[jQuery] Re: Hide/Show when Check Box is selected
Hello again! GENERAL App #1Info [SECRET FIELD FOR App #1] App #2Info [SECRET FIELD FOR App #2] . I'd like to have it so when I click the checkbox for "App #1" only the "secret field" for App #1 becomes visable. Thanks for your help! Best regards On Feb 26, 2:18 pm, Stephan Veigl wrote: > Hi > > the example is working on IDs (see the # in the selector). > If you send a HTML snippet of your page, maybe I better understand > what you mean. > > by(e) > Stephan > > 2009/2/26 nubcake : > > > > > Hey! > > > Is there any simple way to rewrite that so it works on ID:s instead on > > class? > > I have several checkboxes/"hidden divs", but I only want to "unhide" > > the div that belongs to the clicked checkbox. > > > Best regards. > > > On Feb 18, 5:10 pm, Stephan Veigl wrote: > >> Hi Miguel, > > >> you can use the click trigger of the checkbox: > > >> > >> show secret: > >> > >> secret field: > >> > >> > > >> $("#div").hide(); > > >> $("#checkbox").click(function(){ > >> if ( this.checked ) { > >> $("#div").show(); > >> } else { > >> $("#div").hide(); > >> } > > >> }) > > >> by(e) > >> Stephan > > >> 2009/2/18 shapper : > > >> > Hello, > > >> > On a form how can I Show a fieldset when a checkbox is Selected and > >> > Hide the same fieldset when the same checkbox is unselected? > > >> > Thanks, > >> > Miguel
[jQuery] Re: Hide/Show when Check Box is selected
Hey! Is there any simple way to rewrite that so it works on ID:s instead on class? I have several checkboxes/"hidden divs", but I only want to "unhide" the div that belongs to the clicked checkbox. Best regards. On Feb 18, 5:10 pm, Stephan Veigl wrote: > Hi Miguel, > > you can use the click trigger of the checkbox: > > > show secret: > > secret field: > > > > $("#div").hide(); > > $("#checkbox").click(function(){ > if ( this.checked ) { > $("#div").show(); > } else { > $("#div").hide(); > } > > }) > > by(e) > Stephan > > 2009/2/18 shapper : > > > > > Hello, > > > On a form how can I Show a fieldset when a checkbox is Selected and > > Hide the same fieldset when the same checkbox is unselected? > > > Thanks, > > Miguel