PDA

View Full Version : Adding new txt in many popup windows


waeydreki
07-29-2008, 10:26 PM
I am a beginner web page programmer. In my web page, I am trying to have a long list of links to popup windows. In each popup link it will have the code:

<A HREF="javascript:popUp('member.txt')">name</A>

--------------------------------
In the member.txt will be:

Member name:
Rank:
Description:

-------------------------------

This is what I need help. I need to have each popup link to open THE SAME text document however, each popup will need to be filled out with their name and their description. So I need the coding of a way to manually type everyones name, rank and description WITHOUT HAVING many txt documents.

-------------------------------

For more understanding, I am creating a geocities webpage for my video game community. I am trying to have enlisted members and a popup of their description.
This is our old site: http://geocities.com/woaesir/rost.html I am trying to recreate a page similar to that, having popup links to every member. Webmaster to that page is long gone now >.<

-------------------------------

Any help would be appreciated. I would like to have the html or java scripting of it. If there is another way to do it please inform me. Also, If you have any other ideas or tips that would be great. Thank you everyone.

The site I am creating: http://www.geocities.com/waeydreki

oracleguy
07-29-2008, 10:44 PM
Your previous webmaster just hard coded a javascript function for each user.


<script language="JavaScript">
function info008() {

DispWin = window.open('','8','toolbar=no,status=no,width=300,height=200')
message = "<ul><li><b>Name : </b>WA-Mjorsng";
message += "<li><b>Rank : </b>Lieutenant";
message += "<li><b>Title : </b>N/A";
message += "<li><b>Email : </b>Unlisted";
message += "<li><b>AIM : </b>Unlisted";
message += "<li><b>Platoon : </b>Odin's Fist";
message += "<li><b>Division : </b>The Hand of Odin";
message += "<li><b>Site Update Requests : </b>0";
message += "<li><b>Other : </b>N/A</ul>";
DispWin.document.write(message);
}
</script>


It works but it is far from elegant. At the very least the code should be in an external js file so it can be cached by the browser. Even using javascript it could be done more elegantly using arrays.

An even more elegant solution would be to use a server side language to generate the information page dynamically.

waeydreki
07-29-2008, 11:49 PM
Thank you so much. If you have time, do you think u can make it "elegant"?

oracleguy
07-30-2008, 01:32 AM
Javascript or a server side language?

You should give it a shot first yourself; if we do it all for you there isn't much for you to learn. If/When you run into trouble or have questions, post back.