<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">A PDF is also static. The controls for
the PDF doesn't come from code you put in, but rather from the
mimetype handler on the user's browser and the associated
viewer/plugin (ie - Adobe Reader, Chrome's PDF viewer, etc.). Same
thing as clicking a link to an MP3 and your browser's audio player
opens, so long as your browser has a handler associated with the
MP3 mime-type.<br>
<br>
What you are going to need is some browser method of displaying a
PDF within the browser, like FlexPaper, so you control the viewing
mechanism. That you can load into a Colorbox through regular
inline DOM or an iFrame. Even then you still got extra work to do,
either using FlexPaper's desktop publisher or server side (which
means having a VPS or dedicated server so you can install the
needed software).<br>
<br>
You can also load the PDF via an iFrame in Colorbox, meaning the
native PDF viewer in the browser will take over. That would be the
easiest route, but also the one with the least amount of control.
<br>
<br>
<br>
<pre class="moz-signature" cols="72">Jamie Holly
<a class="moz-txt-link-freetext" href="http://hollyit.net">http://hollyit.net</a></pre>
On 10/23/2013 11:16 AM, Chris Miller wrote:<br>
</div>
<blockquote
cite="mid:1425218907.41844.1382541418623.JavaMail.root@tryx.org"
type="cite">
<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" <a class="moz-txt-link-rfc2396E" href="mailto:fredthejonester@gmail.com"><fredthejonester@gmail.com></a><br>
<b>To: </b><a class="moz-txt-link-abbreviated" href="mailto:support@drupal.org">support@drupal.org</a><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>
<a class="moz-txt-link-freetext" href="https://drupal.org/project/colorbox">https://drupal.org/project/colorbox</a><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. I oversimplified the description of what I was
displaying to avoid misdirecting the conversation away for the
aspect of AJAX. I doubt that colorbox will work for the true
content which is a PDF. 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>
<a class="moz-txt-link-freetext" href="https://api.drupal.org/api/examples/ajax_example!ajax_example.module/group/ajax_example/7">https://api.drupal.org/api/examples/ajax_example!ajax_example.module/group/ajax_example/7</a></blockquote>
<div>This would be some of the MANY articles I've read. They do
not explain the questions I have. 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;">>
More specifically, how does 'class="use-ajax" ' do this magic?
I have to<br>
> assume there is an onClick event handler hiding somewhere
above me in the<br>
> DOM looking for the class "use-ajax". Where is this
event listener<br>
> attached? How does it become attached? Where is the
source, so I can see<br>
> 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>
<a class="moz-txt-link-freetext" href="http://www.w3schools.com/php/php_ajax_intro.asp">http://www.w3schools.com/php/php_ajax_intro.asp</a><br>
</blockquote>
<div>I understand the basics of AJAX, and I've used it before.
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;">>
Finally, how do I register my callback function which will
operate on the<br>
> returned JSON, which is a complicated question because I
need an example of<br>
> what I need to write, where I need to put it, and how I
tell Drupal that it<br>
> is there.<br>
<div><br>
</div>
Google for "register ajax callback" and the first result is:<br>
<div><br>
</div>
<a class="moz-txt-link-freetext" href="http://api.jquery.com/ajaxComplete/">http://api.jquery.com/ajaxComplete/</a></blockquote>
<div>This is a jQuery call, which is fine, but I have found no
Drupal documentation that says to make this call. 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. I did get a pointer from another source that sent
me to <a moz-do-not-send="true"
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. 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>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
</blockquote>
<br>
</body>
</html>