google
zungee吧
全部回复
仅看楼主
level 6
yundsky 楼主
2005年05月04日 02点05分 1
level 6
yundsky 楼主
var _u = navigator.userAgent.toLowerCase();function _ua(t) {return _u.indexOf(t) != -1;}function _uan(t) {if (!window.RegExp) {return 0;}var r = new RegExp(t + "([0-9]*)");var s = r.exec(_u);var ret = 0;if (s.length >= 2) {ret = s[1];}return ret;}function _compat() {return ((_ua('opera') &&(_ua('opera 7.5') || _ua('opera/7.5') || _ua('opera/8'))) ||(_ua('safari') && _uan('safari/') >= 125) ||(_ua('msie') &&!_ua('msie 4') && !_ua('msie 5.0') && !_ua('msie 5.1') &&!_ua('msie 3') && !_ua('powerpc')) ||(document.getElementById && window.XSLTProcessor &&window.XMLHttpRequest && !_ua('netscape6') &&!_ua('netscape/7.0')));}function _noActiveX() {if (!_ua('msie') || !document.all || _ua('opera')) {return false; }var s = false;eval('try { new ActiveXObject("Microsoft.XMLDOM"); }' +'catch (e) { s = true; }');return s;}function _el(i) {return document.getElementById(i);}var _forms = ['maps','local','directions'];var _defaults = {'maps': 'q','local': 'what','directions': 'start'};function _form(name, focus) {if (!_c) return true;for (var i = 0; i < _forms.length; i++) {var n = _forms[i];var t = _el(n);var f = _el(n + '_form');if (t) {t.className = (n == name) ? 'selected' : null;}if (f) {f.style.display = (n == name) ? '' : 'none';}}if (focus) { _el(_defaults[name]).focus(); }return false;}function _setPrintHeader(mode) {var t = '';if (!mode) {var q = _el('q').value;if (q) {t += '
Map';t += '
 for
' + q + '';}} else if (mode == 'l') {var where = _el('where').value;var what = _el('what').value;t += '
Local Search';t += '
 for
' + what + '';if (where && where != _wStr) {t += '
 in
' + where + '';}} else if (mode == 'd') {var start = _el('start').value;var end = _el('end').value;t += '
Driving directions
';t += '
 from
' + start + '';t += '
 to
' + end + '';}_el('printheader').innerHTML = t;}function _search(form) {var mode = null;if (_el('local_form').style.display != 'none') {mode = 'l';var what = _el('what');if (!what.value) {what.focus();return false;}} else if (_el('directions_form').style.display != 'none') {mode = 'd';var start = _el('start');if (!start.value) {start.focus();return false;}var end = _el('end');if (!end.value) {end.focus();return false;}} else {mode = 'q';var q = _el('q');if (!q.value) {return false;}}_wfocus(_el('where'));setTimeout("_wblur(_el('where'))", 5);_m.prepareSearchForm(form, mode);_setPrintHeader(mode);return true;}function _submit(form) {if (_c && _m) {return _search(form);} else {return false;}}var _nxsl = !_ua('safari'); function _loadnxsl() {_nxsl = true;_checkLoad();}function _load(xml, doc, loc) {if (!_c) return;if (!_m || !_nxsl) {window._pending = {xml: xml, doc: doc, loc: loc};} else {_m.loadXML(xml, doc, loc);}}function _fd() {var se = _el('start');var ee = _el('end');var s = se.value;se.value = ee.value;ee.value = s;return false;}function _blur() {_el('q').blur();_el('what').blur();_el('where').blur();_el('start').blur();_el('end').blur();}var _wStr = 'the map area below';function _wfocus(w) {if (w.value == _wStr) {w.value = '';}w.style.color = 'black';}function _wblur(w) {if (w.value.length == 0 || w.value == _wStr) {w.value = _wStr;w.style.color = 'gray';}}function _email() {if (!_c || !_m) return;_m.email();}function _print() {if (!_c || !_m) return;_m.print();}function _createMap() {_m = new _MapsApplication(_el('map'),_el('panel'),_el('metapanel'),_el('linktopage'),_el('toggle'));_m.loadMap();_m.map.onmousedown = function() {_blur();};}function _loadbody() {_form('maps', true);_wblur(_el('where'));_checkLoad();}function _checkLoad() {if (window._pending) {var pending = window._pending;window._pending = null;_load(pending.xml, pending.doc, pending.loc);}}function getDirectionsStart() {return _el('start');}function getDirectionsEnd() {return _el('end');}function directionsSearch(form, s, e, formId) {_form('directions');if (s) {_el('start').value = s;}if (e) {_el('end').value = e;}if (s && e) {if (form) {_m.prepareSearchForm(form, formId);} else {form = _el('formd');_m.prepareSearchForm(form, formId);form.submit();}_setPrintHeader('d');return true;} else {if (s) {_el('end').select();} else {_el('start').select();}return false;}}function search(q) {_form('maps');_el('q').value = q;var form = _el('formq');_m.prepareSearchForm(form, 'ex');form.submit();_setPrintHeader('q');}function localSearch(q, near) {_form('local');_el('what').value = q;_wfocus(_el('where'));_el('where').value = near;_wblur(_el('where'));var form = _el('forml');_m.prepareSearchForm(form, 'l');form.submit();_setPrintHeader('l');}function 
2005年05月04日 02点05分 2
level 6
yundsky 楼主
iwOnLoadTo() {var s = _el("infoStart");var ia = _el("infoEnd").value;if (ia != getDirectionsStart().value) {s.value = getDirectionsStart().value;getDirectionsEnd().value = ia;}s.select();_makePasteBox(s);}function iwOnLoadFrom() {var e = _el("infoEnd");var ia = _el("infoStart").value;if (ia != getDirectionsEnd().value) {e.value = getDirectionsEnd().value;getDirectionsStart().value = ia;}e.select();_makePasteBox(e);}_m = null;_sf = 'hl=en';_tv = '.3';_ktv = '1';_kdisable = false;_fc = false;_c = _fc || _compat();window.document.vpage = '
http://maps.google.com/?num=10
';function _loadhistory(id) {eval('try {var vpage = _el(id).getAttribute("vpage");if (vpage) {_load(vpage);window.document.vpage = vpage;}} catch (e) {}');}function _savehistory(id) {eval('try { if (window.document.currentvpage) {' +'_el(id).setAttribute("vpage", window.document.currentvpage); }' +'} catch (e) {}');}//]]>

Maps   Local Search   Directions   
 
 
 
 
What 
e.g., pizza
Where  
e.g., Poughkeepsie, NY

 
Start address
End address
Help
Maps
 
//<![CDATA[
2005年05月04日 02点05分 3
level 6
yundsky 楼主
if (_c) {document.write('
Loading...');}//]]>
//<![CDATA[_mSiteName = 'Google Maps';_mEmailSubject = 'Google Map';_mSearching = 'Searching...';_mZoomIn = 'Zoom In';_mZoomOut = 'Zoom Out';_mZoomSet = 'Click to set zoom level';_mZoomDrag = 'Drag to zoom';_mPanWest = 'Go left';_mPanEast = 'Go right';_mPanNorth = 'Go up';_mPanSouth = 'Go down';_mLastResult = 'Return to the last result';_mGoogleCopy = '©2005 Google';_mDataCopy = 'Map data ©2005 NAVTEQ™, Tele Atlas';_mNormalMap = 'Map';_mNew = 'New!';_mTerms = 'Terms of Use';_mTermsURL = 'http://www.google.com/help/terms_local.html';_mKeyholeMap = 'Satellite';_mKeyholeCopy = 'Imagery ©2005 DigitalGlobe, EarthSat';function _script(src) {var ret = '<' + 'script src="' + src + '"' +' type="text/javascript"><' + '/script>';document.write(ret);}function _havexslt() {if (typeof GetObject != 'undefined' ||(typeof XMLHttpRequest != 'undefined' &&typeof DOMParser != 'undefined' &&typeof XSLTProcessor != 'undefined')) {return true;} else {return false;}}if (_c) { if (_havexslt()) {_script("http://maps.google.com/mapfiles/maps.keyhole.3.js");} else if (_ua('safari')) {_script("http://maps.google.com/mapfiles/maps.keyhole.3.safari.js");} else {_script("http://maps.google.com/mapfiles/maps.keyhole.3.xslt.js");}}//]]>
//<![CDATA[if (_c && _noActiveX()) {_el('loading').style.display = 'none';document.write('<p>ActiveX is not enabled in your browser. If your browser is Internet Explorer, you must have ActiveX enabled to use Google Maps.</p>');} else if (_c) { _makePasteBox(_el('q'));_makePasteBox(_el('what'));_makePasteBox(_el('where'));_makePasteBox(_el('start'));_makePasteBox(_el('end'));_el('loading').style.display = 'none';document.write('<div id="page">');document.write('<div id="map"></div>');document.write('<div id="rhs"><div id="links"><a style="text-decoration:none;white-space:nowrap" href="javascript:_print()"><img src="/mapfiles/print_icon.gif" alt="Print"/> <span style="text-decoration:underline">Print</span></a>   <a style="text-decoration:none;white-space:nowrap" href="javascript:_email()"><img src="/mapfiles/email_icon.gif" alt="Email"/> <span style="text-decoration:underline">Email</span></a>   <a style="text-decoration:none;white-space:nowrap" id="linktopage" href=""><img src="/mapfiles/link_icon.gif" alt="Link to this page"/> <span style="text-decoration:underline">Link to this page</span></a></div><div id="metapanel"></div><div id="panel"></div></div>');document.write('</div>');_createMap(); } else {document.write('<p>Your browser is not officially supported by Google Maps. We currently support the following browsers:</p><ul><li><a href="http://www.microsoft.com/windows/ie/downloads/default.asp">IE</a> 5.5+ (Windows)</li><li><a href="http://www.mozilla.org/products/firefox/">Firefox</a> 0.8+ (Windows, Mac, Linux)</li><li><a href="http://www.apple.com/safari/download/">Safari</a> 1.2.4+ (Mac)</li><li><a href="http://channels.netscape.com/ns/browsers/download.jsp">Netscape</a> 7.1+ (Windows, Mac, Linux)</li><li><a href="http://www.mozilla.org/products/mozilla1.x/">Mozilla</a> 1.4+ (Windows, Mac, Linux)</li><li><a href="http://www.opera.com/download/">Opera</a> 7.5+ (Windows, Mac, Linux)</li></ul><p>We recommend you download one of the browsers above, or you can try to <a href="/?fc=1">load Google Maps</a> in your current browser.</p>');}if (!_nxsl) {document.write('<iframe id="nxsl" onload="_loadnxsl()" src="/maps?file=sf"></iframe>');}//]]>
<p>JavaScript must be enabled in order for you to use Google Maps. However, it seems JavaScript is either disabled or not supported by your browser. To view Google Maps, enable JavaScript by changing your browser options, and then <a href="/">try again</a>.</p>
//<![CDATA[if (_c) {var ret = '<' + 'script id="khcookie" src="/khc"' +' type="text/javascript"><' + '/script>';document.write(ret);}//]]>
2005年05月04日 02点05分 4
1