I’m trying to load Google’s Api on click but it seems whenever I do so, the content gets hidden.
I firstly load the google’s Api: <script src="http://www.google.com/jsapi"></script>
Then on click I load an Api:
$(".test").click(function () {
google.load("language", "1");
});
…And the content gets hidden.
Check it out here: http://jsfiddle.net/hnr6v/
So, how can I load Google’s API’s without the content to get hidden? Is there any another way?
natively, google.load loads on page load (not sure why it would remove all content). However, to dynamically load a library, you need to pass an object with a callback option to the third param of load:
http://code.google.com/apis/loader/#Dynamic