Using JavaScript to display database records

P

Patrick

Hello,

I need some advice on how to handle the following scenario in
Javascript.

Imagine an HTML page that displays relational database records from an
address book application. Each record displayed is simply a summary of
information. In order to see more of the record details the user
clicks on the persons name (set up as a link) to display a popup window
with all of the remaining fields in the record. This allows the user
to display as many popup windows as they like.

This is a very simply application, but I am interested in learning how
to set it up so that the popup window receives the users name (or some
other ID) as a key and looks up the record in the database and
populates the popup window.

Can I do this in HTML alone? Javascript? Any help would be
appreciated.

Patrick
 
P

Patrick

Good said:
You will need to get some back-end action involved in order to look up
the record in the database, so no, you cannot do it in HTML and
Javascript alone. Javascript cannot connect to a database (or a file on
the server (without AJAX)) as its run entirely on the client side (your
browser).



Your popup URL would need to be a backend scripted page, ie. PHP or ASP
(called "more_info.php", for this example), and you would have to pass it
a key/id/reference via the URL. So, on the HTML page, the link to show
more records would have some javascript (to open the pop-up window) and
link to "more_info.php?id=12". Your "more_info.php" page would grab the
id number (12), hit the database for the additional info, and present it.
Of course there are a few other things to consider (will you mind if
people manipulate the id to get info about other users?, etc).


I hope I understood your question...

Yes, you have understood the question well. I appreciate your
response.

The actual application for this functionality is an embedded system
that contains a very scaled down (home grown) webserver that has no way
to handle any fancy back-end processing such as PHP, ASP, etc. So
instead of using this dynamic approach I think I am going to have to
use static web pages, which would work okay.

Thanks again!

Patrick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top