Re: [php-49] Making only part of the page dynamic

From: Andrew
Sent on: Friday, January 16, 2009 10:15 AM
Hey David,

AJAX is the more elegant method. Here's how it works
1. click the company calls a javascript function. in this function you
send the company id to your server script, and specify a callback
2. a server script that you create should take a company id and echo a
JSON string. JSON looks like:

{id: 1; name: david}

3. the callback function handles the server response. in here you'll
manipulate the DOM and interject the values you received from the

* If you use jQuery (or another JS framework) its trivial to handle the request.

// Andrew Woods / Web Developer / http://andrewwood...­

On Fri, Jan 16, 2009 at 9:46 AM, David Malouf <[address removed]> wrote:
> I'm writing to y'all because I don't even know where to begin in my search
> for a solution...
> I have a request to write a page that has a top and bottom 'half' - the top
> half has the name of 5 companies (possibly up to 30, but 5 for now).  The
> bottom half will display the company's address, notes, email, etc.
> I'd like to do this in such a way that doesn't reload the entire page but
> instead, calls only the relevant contact information (the 'bottom half').
> Also, the "5 companies" listed will be dynamically created (i.e. it's not
> always the same 5 companies).
> I've searched online, but I'm not even sure what I'm searching for.  I've
> goofed around in Dreamweaver to see what it does, but the code looks
> unnecessarily complex (flexible, yes.  overkill for me, possibly).
> If you have a quick solution, I'd greatly appreciate the education.  If
> there is a term for this kind of thing, I could use that so as to
> read-the-manual... I just don't have the vocabulary to know what it is I'm
> looking for.
> I'll gladly put in the hard work - I'm just not sure where to start.  Does
> anyone even know what I'm writing about (ha!),
> David Malouf
> --
> Please Note: If you hit "REPLY", your message will be sent to everyone on
> this mailing list ([address removed])
> This message was sent by David Malouf ([address removed]) from The Seattle
> PHP Meetup Group.
> To learn more about David Malouf, visit his/her member profile
> To unsubscribe or to update your mailing list settings, click here
> Meetup Support: [address removed]
> 632 Broadway, New York, NY 10012 USA

Our Sponsors

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy