<div class="grid--cell fl1 lh-lg">
<div class="grid--cell fl1 lh-lg">
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, <a href="/help/reopen-questions">visit the help center</a>.
</div>
</div>
</div>
<div class="grid--cell mb0 mt8">Closed <span title="2013-03-28 03:28:36Z" class="relativetime">7 years ago</span>.</div>
</div>
</aside>
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.)
</div>
An Ajax call on mouseover gives you the ability to refresh modal window content between displays, as every time it mouses over it fires off an query for that window's content and you only get the data you specifically look at. But, you not only need a php script to generate the calendar, but also to return the individual event data in whatever format (xml,json,ical) and interpret that into content.
Hidden modal windows require only one php script and no Ajax calls. But you get more data then you may use.
I would advise the second option unless you are teaching a class on client/server models, translating data formats, and Ajax.