# Posted By

wizard04 on 09/05/08

# Statistics

Viewed 469 times
Favorited by 1 user(s)

# Related snippets

/ Published in: JavaScript
`javascript:(function(){function T(f){try{if(f.getSelection)return f.getSelection().toString();if(f.document.selection)return f.document.selection.createRange().text}catch(e){}return ''}function A(f){var t=T(f);if(t)return t;for(var i=0;i<f.length;i++){t=A(f[i]);if(t) return t}return ''}var a=encodeURIComponent(A(window.top).replace(/[]+/g,", ").replace(/\s+/g," "));if(a)window.open("http://maps.google.com/maps?q="+a)})(); //Here it is expanded so you can read it:javascript:(function(){	function T(f)	//get the selected text in frame f	{		try{			if(f.getSelection) return f.getSelection().toString();			if(f.document.selection) return f.document.selection.createRange().text;		}catch(e){}	//if the frame is in another domain		return '';	}	function A(f)	//get the selected text in frame f and its children	{		var t = T(f);		if(t) return t;		for(var i=0; i<f.length; i++)	//for each child frame		{			t = A(f[i]);			if(t) return t;		}		return '';	}	var a = encodeURIComponent(A(window.top).replace(/[]+/g, ", ").replace(/\s+/g, " "));	if(a) window.open("http://maps.google.com/maps?q="+a);})();`