Can I degrade Google Place Library to a particular version? - javascript

My project is using both Google Map JavaScript API and Place Library based on React. But since google upgraded it to v3.39, I met an issue in IE 10. (Some clients are still using IE 10!) The latest version 3.39 doesn't support IE 10, so I tried to degrade it to 3.38 in different ways but none of them working:
Pass 'v=3.38' when load Place in header: <script src="https://maps.googleapis.com/maps/api/js?v=3.38&key=mykey&libraries=places"></script> -->. It still loaded v3.39.
Manually Load v3.38 Map in header:
<!-- <script src="https://maps.googleapis.com/maps/api/js?v=3.38
&key=mykey&callback=initMap"
async defer></script>
<script src="https://maps.googleapis.com/maps/api/js?key=mykey&libraries=places"></script> -->. The map can be rendered, but address autocomplete will not even show up.
Manually load a 3.38 version when render a map: This method partly works. But browser will display an error said: You have included the Google Maps JavaScript API multiple times on this page. This may cause unexpected errors.
Please give any suggestion on my scenario. Thanks so much!

Related

Competing JQuery Versions - Unknown Loadorder and JQuery.noConflict()

I have a question for you about jQuery.noConflict.
First of all - I did some research on what
jQuery.noConflict(true)
is, my question is related to this closely. So far I have found no answer that I was able to apply to my case, so if the answer is obvious and slipped my mind I apologize in advance.
The problem:
I am currently trying to solve a problem for a very large JS application. The JS application runs on a SAMSUNG browser (based on Orsay), which in turn runs on specific SAMSUNG displays.
To use display functions it is required to include:
<!-- TODO : Common API -->
<script type="text/javascript" language="javascript" src="$MANAGER_WIDGET/Common/API/Widget.js"></script>
<script type="text/javascript" language="javascript" src="$MANAGER_WIDGET/Common/API/TVKeyValue.js"></script>
<script type='text/javascript' src='$MANAGER_WIDGET/Common/af/2.0.0/loader.js'></script>
<script type='text/javascript' src='$MANAGER_WIDGET/Common/API/Plugin.js'></script>
Also to use Deferred objects within the code jQuery 1.9.1 is included:
<script type='text/javascript' src='app/javascript/jquery-1.9.1.js' ></script>
My problem arises from the fact, that the SAMSUNG APIs apparently load whatever it is they are loading in the display's backend, however one of the things they load is their own jQuery version, which is 1.4.2.
The situation is such that I cannot say which version will be loaded at what point. I can start up the display five times having done no changes to the code and will get two times 1.4.2 and three times 1.9.1 or once 1.4.2 and four times 1.9.1 or any other possible order. I suspect this being due to the display's API able to run multithreading, so that the JS application and the API run independently from one another.
So I took a look at the noConflict method, however am unsure how to go about this problem using it.
As said, the application is large. It uses jQuery in various places. So doing something like
jQuery1_9_1 = $.noConflict(true);
after loading our jQuery version is rather unfeasible, since this will cost a large amount of time to fix.
However so far I have found no way to reliably unbind version 1.4.2 from $, because I do not load it, but the display's API does and it is not clear as to when it is loaded.
I hope this question is not redundant and someone has an idea how to go about it.

Google Trends embed_loader URL

We have an app that embeds a Google Trend chart. However every couple of months the chart stops working. Each time it seems that the embed JS version has been incremented and the old version is no longer available.
This was today's fix:
-<script type="text/javascript" src="https://ssl.gstatic.com/trends_nrtr/760_RC01/embed_loader.js"></script>
+<script type="text/javascript" src="https://ssl.gstatic.com/trends_nrtr/962_RC10/embed_loader.js"></script>
Is there any kind of URL that 301's to the latest version? I've tried:
https://ssl.gstatic.com/trends_nrtr/latest/embed_loader.js
... but it doesn't work.
Surely this approach from Google means any page on the internet with an embedded script will eventually break?!

Google Maps Javascript API Doesn't Respond to Touch Events in iOS 10

I run a website with a number of custom Google Maps built in (showing various locations on a map after a search or generating directions to/from a location). I use Google Maps Javascript API for this. My users have started reporting that on iOS 10, these maps no longer respond to touch events -- they cannot pinch-to-zoom nor can they click on the "pins" on the map to open the location info balloons.
I've been searching all over for others who have had this issue to no avail. I found one StackOverflow question here (http://webcache.googleusercontent.com/search?q=cache:DaiSdOgD0U4J:stackoverflow.com/questions/39401974/google-maps-javascript-doesnt-pan-or-zoom-in-ios-10+&cd=3&hl=en&ct=clnk&gl=us), but it was downvoted, then deleted. (Why?) A fresh search today still shows that page, but it leads to a 404, making a search even more frustrating.
Has anyone else experienced this? Is this a bug within the Google Maps API? I certainly can't find anything about that on their Developer website. Am I possibly doing something very wrong to lead to this? The code has worked for years and hasn't been modified in a few months now, so nothing changed on our end.
We do use an API key in our requests
I've tried switching from the
current release version (3.25) to the current experimental version
(3.26) with no changes in functionality.
Users report this happens in at least both Safari and Chrome on iOS 10
Just hoping someone can provide any insight at all on the issue.
Ok here is how I did to fix this issue.
As a reminder i'm using AngularJS via the Ionic framework.
I was calling the map this way in my index.html :
<script src="https://maps.googleapis.com/maps/api/js?libraries=places&key=PUT_YOUR_GOOGLE_API_KEY_HERE&signed_in=true"></script>
It seams like signed_in feature of google map is adding a layer on the map that is not letting the map getting the X,Y of your screen touch position.
I just replaced by false to disable the signed_in feature and its working like a charm
<script src="https://maps.googleapis.com/maps/api/js?libraries=places&key=PUT_YOUR_GOOGLE_API_KEY_HERE&signed_in=false"></script>

How do I prioritize which part of a page should load 1st?

Okay guys I have a website that has a lights off for videos source code: http://www.megaptery.com/allofthelights/
An organic tabs for videos using Jquery
and a 2buttons which onclick it changes the CSS of the whole page you know it's kinda like a theme for the page
Here is an example of one of my page:
http://myanimesekai.com/Watch/Noucome-Episode-9
okay all of them works perfectly fine on my laptop all of them IE, Mozilla and the OLD Google Chrome.
But Then I tried it on my Brothers Laptop BUT his Google Chrome is the latest Google Chrome the Google Chrome where the scrollbar changed. The problem is that the Lights off feature is malfunctioning it doesn't turn off the video only. But the Organic Tabs and The 2buttons works perfectly fine. So I tried it on an internet Cafe and this is where I was really frustrated their Google Chrome is also updated and then both 3 of them were malfunctioning then after a while I tried them on Mozilla and all of them worked perfectly fine and so I have an Idea maybe it's becaused it took time for the Jquery and my Javascript to load which is why all 3 of them were malfunctioning.
so my question is is there a way for me to make my page load the jquery and javascript 1st? or am I missing something that the new Google Chrome requires? this is really frustrating me
oh BTW the 2buttons that changes the CSS are the B and M squares Below the facebook page
There are so many errors on this page (http://myanimesekai.com/Watch/Noucome-Episode-9) that any one error can cause the page not to work.
You need to clean up your code quite a bit:
<script src="http://myanimesekai.com/javascript.js"></script>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js'></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script src="http://myanimesekai.com/organictabs.jquery.js"></script>
You are calling jQuery in your javascript.js file. The jQuery library has not been declared before your scripts. You need to restructure your code to (you only need one version of jQuery):
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script src="http://myanimesekai.com/javascript.js"></script>
<script src="http://myanimesekai.com/organictabs.jquery.js"></script>
This will fix some errors. I suggest that you look at the console for further errors and fix them.

CSS or JavaScript Conflict - Google Map Won't Display

The WordPress theme I am using has built in JavaScript and CSS for Google maps on the contact page. So, I'm guessing there is conflicting code. I can't seem to find where the conflict is when I am trying to use a plugin which also uses Google Maps.
I would really appreciate any help correcting this issue so that this Google Map will display instead of an empty gray box. I tried everything I know to do.
http://boothambuilders.com/service-area/
The plugin works on all other themes I'm using.
Also, this is the only page where the background doesn't display properly. I don't know how it is related to the issue.
It is not a CSS conflict, you are calling the Google Maps API twice...

Categories

Resources