Uncaught ReferenceError: gapi is not defined wordpress?

Anonymous asked 4 years ago

I keep getting this error. Uncaught ReferenceError: gapi is not defined. I can see it in the console log. Please assist. 

Uncaught ReferenceError: gapi is not defined wordpress? was last modified: May 25th, 2015 by Anonymous

Tip: Click on images to make them larger. If you find anything wrong on this page or need further assistance please comment below or contact me. 🙂

Please like, share and subscribe.

Advanced Programming Made Easy

I hope you enjoyed the article. If I was able to help you please consider a tip for the content.

One Time Tip

more tips

Reoccuring Tips

Tips

Cool People Share:
0 Answers
Maximus Mccullough Staff answered 4 years ago

What is going on here is the order the scripts are being called in. Remember that HTML is read left to right, top to bottom. I had an issue with this because of my Google  plus badge that I have on this website.

<script type="text/javascript">gapi.person.go();</script>

The code above must be the last one called in when you are inserting your Google Plus Badge because you have to call in the external script first. However to get away from this issue use the asynchronous code provided by Google. it looks like this below.

Tip: Click on images to make them larger. If you find anything wrong on this page or need further assistance please comment below or contact me. 🙂
<!-- Place this tag in your head or just before your close body tag. -->
<script src="https://apis.google.com/js/platform.js" async defer></script>

<!-- Place this tag where you want the widget to render. -->
<div class="g-person" data-href="//plus.google.com/u/0/7777777YOUR777ID" data-layout="landscape" data-rel="author"></div>
Answer for Uncaught ReferenceError: gapi is not defined wordpress? was last modified: May 25th, 2015 by Maximus Mccullough

Subscribe To My YouTube Channel:

Please like, share and subscribe.

Advanced Programming Made Easy

I hope you enjoyed the article. If I was able to help you please consider a tip for the content.

One Time Tip

more tips

Reoccuring Tips

Tips

Cool People Share: