SitePoint Sponsor

User Tag List

Results 1 to 13 of 13
  1. #1
    SitePoint Evangelist venkat6134's Avatar
    Join Date
    Jul 2010
    Posts
    454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How the AJax page is processing?

    Hi all,
    I want to know how to process a page by using AJAX?

    I have a table with 10MB size of data...

    I have a form, in that i used 4 select boxes.
    First one is populated on column1 of distinct values...
    based on selection of first, second will be populate by fetching column2 data based on column1(selected in first select box), like that upto 4 select boxes are there...

    For this i used AJAX.

    Now my question is;

    Is the data of size 10MB will fetch at the time of loading the AJAX page, and based on selection it will populate on client side...?
    (or)
    Every time the query will go to server and populate the items for each select boxes...?

    Give me the clarification about this...

    Thanking you...

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,506
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by venkat6134 View Post
    Now my question is;

    Is the data of size 10MB will fetch at the time of loading the AJAX page, and based on selection it will populate on client side...?
    (or)
    Every time the query will go to server and populate the items for each select boxes...?

    Give me the clarification about this...
    I don't understand your question. Are you asking what is best?

  3. #3
    SitePoint Evangelist venkat6134's Avatar
    Join Date
    Jul 2010
    Posts
    454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you for your reply...

    how to process a page, having large amount of data, as 10MB?
    Is it increase the bandwidth?

    If 10 users are accessed the page at a time, what happened?

  4. #4
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,506
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by venkat6134 View Post
    Is it increase the bandwidth?
    Yes.
    I wouldn't send 10MB of data. Get only what you need.

  5. #5
    SitePoint Member
    Join Date
    Mar 2011
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What do you mean exactly when you say you have 10 MB of data? Sending 10MB of data to the client's browser is unacceptable. 10 MB large HTML file might event crash the browser. However, if you have 10MB of data in your database, and send only a small portion of it to the client, there should be no problem.

  6. #6
    SitePoint Evangelist venkat6134's Avatar
    Join Date
    Jul 2010
    Posts
    454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I want to shortlist the data from every selection, in this page, i used the AJax;

    Design Cable

    Is there any problem, if data is increased..

  7. #7
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,506
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by venkat6134 View Post
    I want to shortlist the data from every selection, in this page, i used the AJax;

    Design Cable

    Is there any problem, if data is increased..
    That works fine, doesn't it?
    As long as you get only the data you need, there should be no problem.

  8. #8
    SitePoint Evangelist venkat6134's Avatar
    Join Date
    Jul 2010
    Posts
    454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    right now, there is only 200 rows in the database...
    If it increased to a maximum of 5000 rows, at that time is there any problem arises, to populate the data, for select boxes?

    Right now, first select box is populating based on the first column...
    based on the selection of first select box, second will be populate by querying the first column.... and so on..

    In future, any problem are there, if i use like this. In the point of bandwidth or in the point of more users at a time?

  9. #9
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,506
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    If you query the database each time the user does a selection, and send only the data needed for the following dropdown, there should be no problems with bandwidth.

    I don't know how many users you are expecting, but I don't think there should be a problem with too many simultaneous database connections.

  10. #10
    SitePoint Evangelist venkat6134's Avatar
    Join Date
    Jul 2010
    Posts
    454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is it querying the server, after for every selection of the user?
    or all the data is to be at client side?

    If it querying the server, for every time, is there any problem of closing the connection and opening the connection with the database..?

  11. #11
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,506
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by venkat6134 View Post
    Is it querying the server, after for every selection of the user?
    yes
    or all the data is to be at client side?
    no
    If it querying the server, for every time, is there any problem of closing the connection and opening the connection with the database..?
    no

  12. #12
    SitePoint Evangelist venkat6134's Avatar
    Join Date
    Jul 2010
    Posts
    454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanking you for your reply...

    I don't know much about the AJAX.

    Can you explain how it is processing, starting from page-loading?

  13. #13
    SitePoint Member
    Join Date
    Mar 2011
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can learn how to get data using Ajax here: AJAX Introduction

    Say you want to populate the second <select> combo box according to the value chosen in the first combo box. You could then make a javascript function that will pass the value that the user selected in the first combo box to a php script on the server, and use the server response to show the second combo box to the user. Server's response could contain the complete html code for the second combo box, so you just use javascript to place that code in some div where you would like the combo box to show up. When you have such a function, you can simply bind it to the first <select>'s onchange event, and voila.


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
  •