Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does gapi_processed mean?

I've noticed the gapi_processed attribute on a lot of script tags lately but I can't find any good documentation on it.

What does it mean and where can I read more about it?

<script gapi_processed="true" src="..."></script>

EDIT
Here are a couple of examples (check the script tags in the <head> on the first two)

  • http://www.myownbike.de/singlespeed-und-fixie-konfigurator
  • https://developers.google.com/api-client-library/javascript/reference/referencedocs
  • Like buttons and like box vanished (The attribute is added in the answer, but why?)

It looks like it might have something to do with google?

like image 716
Niklas Avatar asked Nov 10 '13 17:11

Niklas


1 Answers

If you load the Google Javascript client through creating a script tag:

var script = document.createElement('script');
script.src = 'https://apis.google.com/js/client.js'
document.body.appendChild(script);

it loads the javascript, but it is not made available as a global on the window object immediately. "gapi_processed" is set to true when window.gapi is a populated object.

for script tags originating in the HTML markup, if you view source through chrome developer tools, you will notice that the attribute is highlighted as changed.

like image 159
jDubs Avatar answered Oct 20 '22 16:10

jDubs