Bonjour,
pour obtenir le texte selectionné dans une iframe j'ai ecrit ce code:
var window = $(document).getElementById('idFrame').contentWindow.window,
t = '',
document = $(document).getElementById('idFrame').contentWindow.document;
if (window.getSelection) {
t = window.getSelection();
} else if (document.getSelection) {
t = document.getSelection();
} else if (document.selection) {
t = document.selection.createRange().text;
}
alert(t);
$.ajax({
type: "POST",
url: "open",
data: { message : t }
}).done(function( msg ) {
alert( "Data Saved: " + msg );
});
mais ça veut pas marcher!!!
j'ai pas compris mon erreur!!
pouvez-vous m'aider et merciiiiiiii d'avance.