** I am currently using the jquery textselect plugin to trigger alerts based on selection text anywhere on the page and it works fine by doing something like:
$(document).ready(function() {
$(document).bind('textselect', function(e) {
alert(e.text);
});
});
Since then, I had to add an iframe to the page, and I need a choice of text to work on the text inside the iframe. I am trying to do something like this, but it does not work:
$(document).ready(function() {
$('#iframeId').load(function() {
$(document.getElementById("iframeId").contentWindow).bind('textselect',function(e) {
alert(e.text);
});
});
At this point, I tried a whole mess for links to an iframe document without any success. Any ideas? **
source
share