Hi,
I have more than 2 weeks working on this thing without find solution.
Just I want to know if it is possible to get the selected text into iframe without have an idea for the content of the iframe because the content is just an url geted by a search on google…..
I have tried this code:
$(document).ready(function(){
$('#idButton').click(function(){
var window = $(document).getElementById('idiframe').contentWindow.window,
t = '',
document = $(document).getElementById('idiframe').contentWindow.document;
if (window.getSelection)
{ t = window.getSelection();
alert(t);}
else if (document.getSelection)
{ t = document.getSelection();
alert(t);}
else if (document.selection)
{ t = document.selection.createRange().text;
alert(t);}
else{
alert('doesnt.work');
}
});});
but it didn’t work!!