I want to test a GetSelection code.
The code is the following:
function GetSelectedText () {
if (window.getSelection) { // all browsers, except IE before
version 9 var range = window.getSelection ();
alert (range.toString ());
}}
This code assumes that a text segment is selected in a webpage.
The console seems that it does NOT communicate/interact with the webpage where
it is opened.
How am i going to validate the above code?
I wrote the code in the console, selected text from the webpage, pressed the
run command and what i get is *undefined*.
I do not think the code is wrong, it is just that the firebug console seems not
to communicate with the webpage where it is opened.
I am talking only for the console, no problem with css or html.
Thanks.
--
You received this message because you are subscribed to the Google Groups
"Firebug" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/firebug/-/VpOgT3jmesoJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/firebug?hl=en.