1

I am developing a new website, I have a contact list there, which shows the contact details.

It has this setup [checkbox,Firstname,lastname,group,mobile number].

My client is creating his own contacts and save them to the DB. When the client presses the save button the contact record is added to the list in the same page.

So, What I am using here to show the client in the list after saving is to call the (get_contactlist()) function and call the page_view again. which really slows the website.

Can you help me how to solve this issue using jquery?

My code below which I use to draw the contact list divs:

<div class="list_data">

<? if ($res_contactslist) {
    while($contacts_row = mysql_fetch_assoc($res_contactslist)) {
             print'<div class="headings_01" id="account_record">
                   <div class="checkbox_01"><input name="contact_id[]" id="contact_id" type="checkbox" value="'.$contacts_row['contact_id'].'" style="margin-top:0px;" /></div>
                   <div class="firstname_01" name="fname">|'.$contacts_row['contact_id'].'|'.$contacts_row['firstname'].'</div>
                   <div class="lastname_01" name="lname">'.$contacts_row['lastname'].'</div>
                   <div class="group_01">G1</div>
                   <div class="mobile_nmbr_01" name="phone" id="phone">'.$contacts_row['phone'].'</div>
                   </div>';
                 }
         }
1
  • you can use the ajax for this Commented Dec 30, 2011 at 9:31

2 Answers 2

1

Set up an external PHP page that grabs info from the database.

Call that page through one of jQuery's Ajax methods, like $.post(), $.get(), or just $.ajax()`.

Here is more info on $.ajax().

Sign up to request clarification or add additional context in comments.

Comments

1

if you want to use jQuery to display content without refreshing the page, you can use jQuery ajax

for more information about how to use ajax,

http://cmsnsoftware.blogspot.com/2011/01/how-to-call-csharp-function-in-ajax.html

http://cmsnsoftware.blogspot.com/2011/02/how-to-use-ajax-auto-complete-in-aspnet.html

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.