I want to have modal windows produced by Javascript for a calendar program, acting sort of like tooltips (wave your mouse pointer over an event link, and you get a modal popup describing the event). The events are stored in MySQL, accessed by PHP.
From what I'm reading, I can get that information into my Javascript modal popup two ways:
An Ajax call: write a PHP script to generate that information, and use Ajax to call it, when I open the modal window
Let PHP generate a hidden modal window for every link in the calendar; Javascript can activate the appropriate one when opening the modal window.
Will either of these not work, or does either seem like horrible programming style? I'm preparing for a class (teaching it, not taking it), so I want things to be as simple and easy to read as possible. To whatever degree possible, I'm using Javascript and DOM, but not jQuery or Ajax (but I'll do what I must to get it working.)