草庐IT

google-input-tools

全部标签

javascript - 使用本地存储和 Google Analytics 进行 AB 测试

我正在我的电子商务网站上运行全站AB测试。访客登陆后,我会为他们分配一个本地存储键/值:functionisLocalStorageNameSupported(){vartestKey='test',storage=window.localStorage;try{storage.setItem(testKey,'1');storage.removeItem(testKey);returntrue;}catch(error){returnfalse;}}$(function(){if(isLocalStorageNameSupported()){varversion=Cookies.ge

javascript - 使用 Google Elevation Service 处理超过 2 个请求时出现 `OVER_QUERY_LIMIT` 错误

前提我正在使用GoogleElevationService获取路径上所有节点的高程,由用户绘制到Leafletmap上。这允许我生成海拔图。目前,如果我发出超过2个请求(每个请求有512个位置的限制),我总是会遇到OVER_QUERY_LIMIT。使用政策2,500freerequestsperday,calculatedasthesumofclient-sideandserver-sidequeries;enablebillingtoaccesshigherdailyquotas,billedat$0.50USD/1000additionalrequests,upto100,000r

javascript - 我如何判断 <input type=number> 是空白还是具有无效值?

如果用户在中键入无效值(例如:“1.2.3”),然后Chrome和Firefox报告的value属性为""而不是"1.2.3".那么,我如何判断用户是否在中输入了无效数字?或者只是留空?我尝试使用valueAsNumber属性,但它是NaN在这两种情况下。functionshowInputValue(){constinputValue=document.getElementById("numberInput").value;constinputValueAsNumber=document.getElementById("numberInput").valueAsNumber;conso

javascript - 在 Google Chrome 中使用 javascript 移除网站图标

如何在谷歌浏览器中使用Javascript删除网站图标?目标是将其恢复为浏览器默认值,在本例中为空白图像。我找到了this问题,但如果您将link.href属性保留为空,它将不起作用。即使因为服务器上有favicon.ico文件而设置了favicon,我也想将其删除并将其设置回默认值。这只需要在chrome中工作。谢谢! 最佳答案 您是否尝试过使用空的透明图像?尝试:data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6Q

javascript - Google map 在 div 中时不起作用

我正在尝试使用GoogleMapsAPI,而要包含map的div只有在不在另一个div中时才有效。我用两个map创建了一个小示例代码,第一个有效,第二个无效。如果我删除这段代码的文档类型,两者都有效。有什么想法吗?html{height:100%}body{height:100%;margin:0px;padding:0px}#map_canvas{height:50%}#map_canvas2{height:50%}Mapfunctioninitialize(){varlatlng=newgoogle.maps.LatLng(20,20);varmyOptions={zoom:8,c

javascript - window.open 高度在 Google Chrome 中与其他浏览器不同

我正在使用javascript的window.open在用户点击指定宽度和高度(760x581)时打开浏览器窗口,这在InternetExplorer、Safari和Firefox上工作正常,但谷歌浏览器给我带来了问题。在其他浏览器中,高度被正确用作内容的高度,但在GoogleChrome中,它使实际浏览器窗口高581像素而不是内容。有办法解决这个问题吗?clickhere 最佳答案 所以我把事情搞砸了,发现一些浏览器支持window.open的属性innerHeight并且以下内容在所有具有所需内容高度的浏览器中按预期工作在775

javascript - 适用于 Node.js 的 Google 文档 API

是否有我可以在Node.js中使用的适用于Google文档的JavaScriptAPI或第三方框架?谢谢 最佳答案 Google应用程序允许RESTfulAPI访问资源。请引用相同的协议(protocol)指南http://code.google.com/apis/documents/docs/developers_guide.html 关于javascript-适用于Node.js的Google文档API,我们在StackOverflow上找到一个类似的问题:

javascript - 我想在点击 Google Plus 按钮时调用 Google Plus 回调函数

我在我的项目[内置CodeIgniter]中使用了GooglePlus按钮。我在这里添加了以下代码。然后我添加了Google提供的Javascript代码。(function(){varpo=document.createElement('script');po.type='text/javascript';po.async=true;po.src='https://apis.google.com/js/client:plusone.js';vars=document.getElementsByTagName('script')[0];s.parentNode.insertBefore

javascript - Event.keyCode 不适用于 'on input' - 未定义

目前我正在为项目开发一项功能,并且event.keyCode出现不适用于“输入时”触发器。我正在使用谷歌浏览器31和jQuery1.10.2。这是我在我的方法中尝试的:input.on('input',function(event){console.log("event.charCode:"+event.charCode);console.log("event.keyCode:"+event.keyCode);console.log("event.which:"+event.which);console.log("window.event?event.keyCode:event.whi

javascript - 在没有 map 的情况下使用 Google Places API 库 - javascript

我需要从特定坐标获取100米半径内最近的机构。我找到了GooglePlacesAPI示例代码,但我没有在我的应用程序中使用map,因为该结果将呈现在列表中。这是API代码:varmap;varinfowindow;functioninitialize(){varpyrmont=newgoogle.maps.LatLng(-33.8665433,151.1956316);map=newgoogle.maps.Map(document.getElementById('map-canvas'),{center:pyrmont,zoom:15});varrequest={location:py