Jump to content

Dynamic Pop-Up Window


ashleysmithd

Recommended Posts

Hi, I wondered if anyone could point me in the right direction with my college project, I am trying to create a dynamic popup window, which runs a MySQL query, returning information based upon the particular link someone clicked. For instance, in the attached photo I have a series of cast and crew, who's names are currently linked to their e-mail addresses within the database. What I want it to do is open a new window, displaying their bio. However, I do not want to create an individual html file for each and every cast and/or crew member. What I want to be able to do is create some kind of variable upon clicking the link, which can be used within the newly opened window, within the MySQL query, thus returning the relevant biography information, based solely on the specific link the user clicked. The reason I've posted this in the HTML section and not the MySQL section, is because I'm comfortable with returning results from a MySQL query, what I'm not so sure about is how to include some kind of variable when clicking the link that it can be used within the pop-up window. If it is better suited to the MySQL section, I will request for it to be moved. To quite honest, I don't know the best way of going about this. Has anyone got any suggestions or recommendations as to what I should try? Many thanks.

post-95403-0-30755100-1335019899_thumb.jpg

Link to comment
Share on other sites

Brilliant thanks it's now working. This isn't a HTML issue I'm sure, but to save spamming the board with new threads, I'm struggling to call Javascript functions within DIV's that are re-loaded every 5 seconds via AJAX. I've been hacking away at it for hours now and have narrowed it down to an issue with either the DIV, AJAX or both. The JavaScript functions work fine outside of the AJAX DIV's, and I've tried ridding any PHP or MySQL temporarily. The example JavaScript I'm using within my AJAX DIV is as follows:

<html><head><script type="text/javascript">function displaymessage(){alert("Hello World!");}</script></head><body><form><input type="button" value="Click me!" onclick="displaymessage()" /></form><p>By pressing the button above, a function will be called. The function will alert a message.</p></body></html>

I've tried all kinds of things, for several hours but haven't really got anywhere with it. The reason I want a JavaScript function within my DIV is because the pop-up window (which works fine) is not centered, but the only apparent way to center it from the examples I've seen, is to declare a function that uses variables, and then call it. However, I am unable to call any JavaScript functions within any of my AJAX loaded DIV's. Any help with this would be really appreciated. Thanks again.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...