# AJAX status update to application just before a external sit

**URL:** <https://www.ruby-forum.com/t/ajax-status-update-to-application-just-before-a-external-sit/85378>\
**Category:** Rails\
**Created:** [February 13, 2007, 2:07am UTC](https://www.ruby-forum.com/t/ajax-status-update-to-application-just-before-a-external-sit/85378 "2007-02-13T02:07:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![greg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@greg](https://www.ruby-forum.com/u/greg)\
**Post date:** [February 13, 2007, 2:07am UTC](https://www.ruby-forum.com/t/ajax-status-update-to-application-just-before-a-external-sit/85378/1 "2007-02-13T02:07:45Z")

</div>

Hi,

I’m incorporating a Palpal donate button on my site, however I’d like to  
be  
able to send an update (AJAX) to my application to alert it to the fact  
that  
the user has clicked on donate, and hence would be in the process of  
being  
taken to the PayPal site.

Is there a way to wrap an AJAX update back to my application around an  
external site’s link that I embed.

Tks  
Greg

---

<div class="post-metadata">

**Author:** ![greg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@greg](https://www.ruby-forum.com/u/greg)\
**Post date:** [February 13, 2007, 10:09am UTC](https://www.ruby-forum.com/t/ajax-status-update-to-application-just-before-a-external-sit/85378/2 "2007-02-13T10:09:33Z")

</div>

On Feb 13, 3:06 am, “Greg H.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Is there a way to wrap an AJAX update back to my application around an  
> external site’s link that I embed.

Take a look at how any popular web analytics package handles the  
tracking of outclicks. For example:

```
http://s10.sitemeter.com/js/counter.asp (Note: Copyright)

```

Basically, you add an onclick event handler to every link in the  
document by iterating over document.links.

Ciao,  
Sheldon.

---

<div class="post-metadata">

**Author:** ![greg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@greg](https://www.ruby-forum.com/u/greg)\
**Post date:** [February 13, 2007, 10:40am UTC](https://www.ruby-forum.com/t/ajax-status-update-to-application-just-before-a-external-sit/85378/3 "2007-02-13T10:40:36Z")

</div>

thanks Sheldon - you don’t happen to know whether prototype or  
scriptaculus  
have this type of feature inbuilt somewhere?  
Greg

---

<div class="post-metadata">

**Author:** ![greg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@greg](https://www.ruby-forum.com/u/greg)\
**Post date:** [February 13, 2007, 11:09am UTC](https://www.ruby-forum.com/t/ajax-status-update-to-application-just-before-a-external-sit/85378/4 "2007-02-13T11:09:40Z")

</div>

On Feb 13, 11:40 am, “Greg H.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> thanks Sheldon - you don’t happen to know whether prototype or scriptaculus  
> have this type of feature inbuilt somewhere?

Well they both support iterating over document elements (although  
iterating over document.links is easy enough), and from there I’d  
imagine it’s just the usual remote post handling.

Ciao,  
Sheldon.
