Hi,
Wat I'm tryin to do is read in some text using:
function getSelectedText() {
if (document.selection) {
var range = document.selection.createRange();
document.body.createTextRange();
var str =range.text.toString()
return str;
}
}
then add str to the search string for google using:
function googleSearch()
{
var target='http://www.google.com/search?q=';
var str = getSelectedText();
self.name = "body";
msgWindow = window.open(target + str);
}
and finally call it through a context menu.
However the google search returns [object] or nothing.
Any ideas???



Reply With Quote

Bookmarks