SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2006
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Slow <input type=select> when using AJAX

    Hi All,

    I am coding a real estate web site and it uses some AJAX for the following:

    1) When selecting Country - an AJAX request gets areas for that Country and builds an area select box.
    2) When selecting an Area an AJAX request gets towns in that Area and creates a select box.

    Everything is working fine, but the whole thing seems a bit slow as the select boxes stay open until the AJAX returns with the result.

    Is there some sort of JavaScript command that can close the select box while I wait for the Ajax to return?

    PM me if you would like to see the site.
    Soren Beck Jensen

    http://www.automaticbacklinks.com - Free link exchange network
    http://www.notwebdesign.com - Joomla web design in Spain

  2. #2
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could have some sort of loading indicator (animated gif for example) to show the user that something is actually happening. He might get confused otherwise.

    If you simply wanna show and hide the dropdown you can toggle its style display property.

  3. #3
    SitePoint Enthusiast
    Join Date
    Jun 2006
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well - I think you misunderstand.

    It stays OPEN.

    You know when you have a dropdown - you click on the arrow and it OPENS to show you about 20 list items and you can then select one.

    Normally when you select an item the drop down immediately closes and the chosen option i shown.

    My dropdown stays OPEN until the AJAX has fetched and written the output needed which can take 1-2 seconds - this makes it seem a bit sluggish or slow.

    I agree that there should be an animation indicating that something is loading, but right now the OPEN select box is covering the area where the animation would appear.
    Soren Beck Jensen

    http://www.automaticbacklinks.com - Free link exchange network
    http://www.notwebdesign.com - Joomla web design in Spain

  4. #4
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You got any url where this can be seen?

  5. #5
    SitePoint Enthusiast
    Join Date
    Jun 2006
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Check PM
    Soren Beck Jensen

    http://www.automaticbacklinks.com - Free link exchange network
    http://www.notwebdesign.com - Joomla web design in Spain

  6. #6
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sent you a suggestion via PM.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •