<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; color: #000000"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"Fred Jones" &lt;fredthejonester@gmail.com&gt;<br><b>To: </b>support@drupal.org<br><b>Sent: </b>Wednesday, October 23, 2013 4:22:17 AM<br><b>Subject: </b>Re: [support] AJAX<br><div><br></div>This is actually what Colorbox already does. Probably that's all you need:<br><div><br></div>https://drupal.org/project/colorbox<br></blockquote><div>I'll investigate this, because even if it doesn't work for the current project, it will definitely work for the Photo Album part.&nbsp; I oversimplified the description of what I was displaying to avoid misdirecting the conversation away for the aspect of AJAX.&nbsp; I doubt that colorbox will work for the true content which is a PDF.&nbsp; A picture is static, but a PDF needs controls like download and scroll bars.<br></div><div><br></div><div><br></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;">If not, Google for "drupal ajax" and you will find the third result in<br>Google is an EXAMPLE of how to do it in Drupal, right on the Drupal<br>API site:<br><div><br></div>https://api.drupal.org/api/examples/ajax_example!ajax_example.module/group/ajax_example/7</blockquote><div>This would be some of the MANY articles I've read.&nbsp; They do not explain the questions I have.&nbsp; I am sure there will come a day when I can read this and completely understand it but right now it does not explain things usefully. I've read it many times and I have not been able to produce anything useful, which is why I am asking questions.<br></div><div><br></div><div><br></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;">&gt; More specifically, how does 'class="use-ajax" ' do this magic? &nbsp;I have to<br>&gt; assume there is an onClick event handler hiding somewhere above me in the<br>&gt; DOM looking for the class "use-ajax". &nbsp;Where is this event listener<br>&gt; attached? How does it become attached? &nbsp;Where is the source, so I can see<br>&gt; both the event handler and the attachment?<br><div><br></div>To understand the basics of Ajax if you prefer to do it yourself,<br>start with a tutorial. Here's one I found on Google:<br><div><br></div>http://www.w3schools.com/php/php_ajax_intro.asp<br></blockquote><div>I understand the basics of AJAX, and I've used it before.&nbsp; What I DON'T understand is how to use AJAX withing the confines of Drupal, which is not an AJAX question, but a Drupal question.<br></div><div><br></div><div><br></div><div><br></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;">&gt; Finally, how do I register my callback function which will operate on the<br>&gt; returned JSON, which is a complicated question because I need an example of<br>&gt; what I need to write, where I need to put it, and how I tell Drupal that it<br>&gt; is there.<br><div><br></div>Google for "register ajax callback" and the first result is:<br><div><br></div>http://api.jquery.com/ajaxComplete/</blockquote><div>This is a jQuery call, which is fine, but I have found no Drupal documentation that says to make this call.&nbsp; So, this is also not illustrative.<br></div><div><br></div><div><br></div><div><br></div><div>I appreciate that you tried to help, but I still have many questions.&nbsp; I did get a pointer from another source that sent me to <a href="http://www.interactivejunky.com/tutorial/ajax-commands-drupal-7">http://www.interactivejunky.com/tutorial/ajax-commands-drupal-7</a> which has allowed me to create a minimal working example from which I can increase my understanding through brute force experimentation and intrusive debugging.&nbsp; My recommendation to anybody following the path I am on is to read this.<br></div><div><br></div><div id="7efa7f5a-1971-4899-924b-381798d72bd2"><div>Chris.</div></div></div></body></html>