如何在网页上加载此内容后才能显示内容?(How I can show content only after loading this content on a web page? [closed])
我是网络开发的新手,我遇到了一个无法解决的问题。
问题:我需要在加载内容后显示内容。
## file.js ## //on click this code run! //and after click i see web site load content var toInsert = $('<div class="togllecomposition tg'+number+'">\ <div class="infoclip">'+info+'</div>\ <iframe width="420" height="315" src="'+clip+'" frameborder="0" allowfullscreen></iframe>\ <div class="comments">\ <div class="commentlabel">Комментарии:</div>\ <div class="comment">\ <div id="hypercomments_widget'+id_composition+'"></div>\ ' + _hcwp.push({widget:"Stream", widget_id: ID, xid: id_composition, append:"#hypercomments_widget"+id_composition, hc_disabled: 1}) +'\ </div>\ </div>\ </div>'); //this didn't work $(toInsert).load(function() { $(".composition".concat(number)).after(toInsert); }); // this work but with lags because content in process of loading $(".composition".concat(number)).after(toInsert);
我怎么解决这个问题?
I'm new to web development, and I have a problem I can't solve.
Problem: I need to show content after loading that content.
## file.js ## //on click this code run! //and after click i see web site load content var toInsert = $('<div class="togllecomposition tg'+number+'">\ <div class="infoclip">'+info+'</div>\ <iframe width="420" height="315" src="'+clip+'" frameborder="0" allowfullscreen></iframe>\ <div class="comments">\ <div class="commentlabel">Комментарии:</div>\ <div class="comment">\ <div id="hypercomments_widget'+id_composition+'"></div>\ ' + _hcwp.push({widget:"Stream", widget_id: ID, xid: id_composition, append:"#hypercomments_widget"+id_composition, hc_disabled: 1}) +'\ </div>\ </div>\ </div>'); //this didn't work $(toInsert).load(function() { $(".composition".concat(number)).after(toInsert); }); // this work but with lags because content in process of loading $(".composition".concat(number)).after(toInsert);
How can I solve this problem?
原文:https://stackoverflow.com/questions/31876819
最满意答案
我找出了原因。
如果您使用的是不正确的Google Maps API密钥,或者正确的密钥权限不足,则会发生这种情况。 这是我们的后一个原因。
为进一步阅读文档链接 ,尽管上述行为在任何地方都没有提及。 它应该记录一条错误消息。
I have figured out the reason.
If you are using an incorrect google maps api key, or correct key with insufficient permissions, then this will happen. It was the latter reason for us.
For further reading, documentation link, although the said behaviour is not mentioned anywhere. It should rather log an error message.
相关问答
更多-
屏幕截图中的路径实际上是由此代码显式绘制的: [path addCoordinate:CLLocationCoordinate2DMake(-33.86, 151.20)]; [path addCoordinate:CLLocationCoordinate2DMake(-25.30, 140.50)]; [path addCoordinate:CLLocationCoordinate2DMake(-32.90, 151.80)]; 您正在进行的调用返回一个JSON字符串。 您应该从 ...
-
如何使谷歌地图片段,并直接从谷歌地图iOS应用程序?(how to make google map snippet and directly move to google maps from iOS app?)[2023-08-10]
似乎您应该遵循适用于iOS的Google Maps URL方案 。 如果安装了Google地图应用,则会打开; 否则Google地图网页将打开。 我没有这样做,但我就是这样读的。 如果您真的想拥有Google地图应用,则可以显示指向下载网址的链接 - 但您无法强制执行此操作。 这也是一个非常恼人的用户体验,Google会提醒您安装本地应用程序,因此看到这样的提示出现两次会更加恼人。 Seems like you should follow the Google Maps URL Scheme for iOS ... -
使用Swift 3.1 var oldCoodinate: CLLocationCoordinate2D? = CLLocationCoordinate2DMake(CDouble((data.value(forKey: "lat") as? CLLocationCoordinate2D)), CDouble((data.value(forKey: "lng") as? CLLocationCoordinate2D))) var newCoodinate: CLLocatio ...
-
使用限制不适用于移动API,请参阅此处: https://developers.google.com/maps/faq#usage_apis ...适用于移动平台(如Android和iOS)的原生Maps API不受影响。 但请注意,如果您正在开发一个公众无法使用的企业应用程序,那么它可能不被允许,请参阅此处: https://developers.google.com/maps/faq#tos_commercial 但是,并非所有的商业用途都是允许的。 例如,如果您的网站符合以下任何条件,则必须购买适当的 ...
-
Google地图在iOS中闪烁(Google Map flickering in iOS)[2022-11-16]
我找出了原因。 如果您使用的是不正确的Google Maps API密钥,或者正确的密钥权限不足,则会发生这种情况。 这是我们的后一个原因。 为进一步阅读文档链接 ,尽管上述行为在任何地方都没有提及。 它应该记录一条错误消息。 I have figured out the reason. If you are using an incorrect google maps api key, or correct key with insufficient permissions, then this will ... -
如何在ios的Xamarin谷歌地图组件中处理点击事件(how to handle click event in Xamarin google map component for ios)[2023-03-25]
MapView有一个tapped事件,以及多个Touches *事件 mapView.Tapped += delegate(object sender, GMSCoordEventArgs e) { Console.WriteLine("tapped at " + e.Coordinate.Latitude + "," + e.Coordinate.Longitude); }; MapView has a tapped event, as well as multiple Touches* event ... -
Google Maps SDK for iOS的地图与Google Map不同(Google Maps SDK for iOS's map is not same as Google Map)[2023-08-20]
我在昨晚测试一个小区域时发现了同样的问题。 细节POI(可能是当MapView的zoomLevel大于16?)在Yours.app和GoogleMaps.app之间是不同的 而且很容易解释:谷歌需要保持核心竞争力。 在地图业务中,数据就是一切。 I found the same problem last night when testing a small area. The detail POIs (maybe when the zoomLevel of MapView is greater than 1 ... -
请尝试以下代码 GMSCameraPosition *cameraPosition; - (void)mapView:(GMSMapView *)pMapView didChangeCameraPosition:(GMSCameraPosition *)position { /* move draggable pin */ if (fixedMarker) { // stick it on map and start dragging from ...
-
如何检查用户是否在IOS6中安装了谷歌地图?(How to check whether the user has google maps installed in IOS6?)[2022-09-07]
“您可以使用comgooglemaps网址方案为iPhone启动Google地图应用,并执行搜索,定向请求和显示地图视图。启动Google地图时,您的包标识符会自动作为请求的一部分发送。” “在向应用程序中的用户提供其中一个URL之前,您应首先验证应用程序是否已安装。您的应用程序可以使用以下代码检查URL方案是否可用: [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@“comgooglemaps://”]]; “ htt ... -
您也可以尝试使用google.maps.KmlLayer 。 您是否考虑过使用Google Maps API v3的新KmlLayer? 基本上,这里发生的事情是Google充当抓取任何公开可用的KML图层的代理,并自动将其分解为图块。 此平铺图层还可以响应与矢量图层非常相似的点击事件。 ( 链接 ) 请参考https://gis.stackexchange.com/上的类似主题 。 You can also try to use google.maps.KmlLayer. Have you conside ...