Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript creating a directory and grabbing info

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #43628
    shamai
    Member

    I am creating a business directory.
    on the directories listing page where all the businesses are listed, I have that when you hover over the thumbnail of a listing it shows a google map and some info for that listing.

    I can do this 2 ways:

    I can have the thumbnail and the google maps (might be 50 of them loading on 1 page) and info all loaded on page load and then hide the info and maps till hover on. This means everything is loaded onto the page.
    OR
    I can have the thumbnails load and then on hover have ajax grab the info from another page.

    which one is smarter and faster?

    i’ve never used ajax to load things before, so Im itching to try it.

    #129529
    chrisburton
    Participant

    Ajax would be smarter and faster compared to the other solution. I’d just pay very close attention to minimize each http request and compress your stylesheets and scripts as much as possible.

    #129531
    JohnMotylJr
    Participant

    I would suggest to have the images load, preferably use javascript to defer a load until the dom is built that way they will be cached into the browser rather than trying to use ajax to call them depending on what link is hovered. Like chris said, if there is going to be a lot of images then you need to optimize your resources as much as possible.

    If you were to go about using ajax just dont forget about using $.Deferred because you can have so much more control, but like i said, i wouldn’t go the ajax route just yet.

    #129545
    shamai
    Member

    ive never used deferred so i have no clue what it does.
    when you say have the images load, do you mean have the thumbnails load?
    what about the rest of the info and the google maps?

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.