[support] I would like to be able within a Drupal module's hook do an ajax call to a Java Servlet.
Jim Tarvid
tarvid at ls.net
Thu Apr 15 11:01:37 UTC 2010
On Thu, Apr 15, 2010 at 6:51 AM, John Mitchell <mitchelljj98 at gmail.com>wrote:
> I am trying to make this as simple as possible:
>
> As an example (listed below) I have a javascript ajax call to a java
> servlet within my existing Apache Tomcat web application not Drupal.
> All that would need to be modified would that the URL have to be the
> full path.
>
> Is their a way within Drupal to embed a javascript call similar to the
> one listed below?
>
> Thanks,
>
> John
>
> <script type = "text/javascript">
> function download(link){
> var email = document.getElementById('email');
> var xmlHttpReq = new XMLHttpRequest();
> var url = 'ecommerce?command=serve&name=' + link + '&email=' +
> email.value;
> xmlHttpReq.open('post', url, true);
> xmlHttpReq.onreadystatechange = function() {
> if (xmlHttpReq.readyState != 4) {
> return;
> }
> else {
> var responseText = xmlHttpReq.responseText;
> return false;
> }
> }
> xmlHttpReq.send(null);
> }
> </script>
>
>
> Apache Solr Integration does something similar, you might be able to find
some clues - http://drupal.org/node/343467
--
Rev. Jim Tarvid, PCA
Galax, Virginia
http://ls.net
http://drupal.ls.net
http://crossleft.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20100415/5153341b/attachment.html
More information about the support
mailing list