Home > Javascript, Programming > Simple Jquery Function

Simple Jquery Function

April 1st, 2009

I need a jQuery code snippet that will detect when the user copies text/image on the page to clipboard and send this information together with current URL and HTTP_REFERRER via Ajax to the specified URL.

1. If Text is copied call target_url?what=text&refer=HTTP_REFERRER&url=[current page url]&content=[copied text]

2. If Image is coped call target_url?what=image&refer=HTTP_REFERRER&url=[current page url]&content=[image title tag]&alt=[image alt tag]&image_url=[image url]

I’d also like the option to call the target URL without Ajax (since ajax will work only on the same server). For example by dynamically creating an invisible iframe.


Simple Jquery Function

Comments are closed.
Bear