guptahanu / google-ajax-apis

Automatically exported from code.google.com/p/google-ajax-apis
0 stars 1 forks source link

google.load callback not called in IE7/8 #410

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Load the google search API using the "Dynamic Loading" method described 
in: http://code.google.com/apis/ajax/documentation/#Dynamic
2. In IE7 or IE8, load the page that calls this script. -> The callback 
*might* be called this time.
3. Refresh the page. -> The callback will not be called again until you 
clear the browser cache.

What is the expected output? What do you see instead?
I would expect to have my callback executed, but nothing happens instead.

What version of the product are you using? On what operating system?
this is working in FF and safari/Chrome.

Please provide any additional information below.
I am loading jasapi using the jQuery $.getScript() method:

$.getScript('http://www.google.com/jsapi',function(){
  google.load('search','1', {'language':'en',
              callback':function(){alert('hello')}});
});

I am using IE8 in all available modes.

Original issue reported on code.google.com by donnythe...@gmail.com on 23 Mar 2010 at 4:11

GoogleCodeExporter commented 8 years ago
Type-o in sample code.  Should be:
$.getScript('http://www.google.com/jsapi',function(){
  google.load('search','1',
    {'language':'en',
     'callback':function(){alert('hello')}});
});

Original comment by donnythe...@gmail.com on 23 Mar 2010 at 4:13

GoogleCodeExporter commented 8 years ago
It is something to do with jQuery.  Here are two files that *always* work in 
Firefox.  
this_fails.html only works in IE7/8 after the cache is cleared.
(NOTE: I tried $.ajaxSetup({cache:false}) , and that didn't help)

this_works.html: Always works in all browsers.
this_fails.html: Fails in IE7/8 with the exception of the single load after the 
cache 
has been cleared.

Original comment by donnythe...@gmail.com on 23 Mar 2010 at 4:51

Attachments:

GoogleCodeExporter commented 8 years ago
It has nothing to do with jQuery, the $.getScript callback fires properly. This 
issue 
appeared only a few days ago.

Original comment by balazs.endresz on 26 Mar 2010 at 6:00

GoogleCodeExporter commented 8 years ago
The are 2 callbacks here.

Yes, the $.getScript() callback fires properly.  Agreed.
It is the callback in the google.load function that does not get called when 
used in 
conjunction with $.getScript()

Please try the test files.

Original comment by donnythe...@gmail.com on 26 Mar 2010 at 6:05

GoogleCodeExporter commented 8 years ago
Also, if you call google.load once again afterwards then it works fine in IE.

Original comment by balazs.endresz on 26 Mar 2010 at 6:06

GoogleCodeExporter commented 8 years ago
Please elaborate.  Call google.load a 2nd time with the same parameters?

Original comment by donnythe...@gmail.com on 26 Mar 2010 at 6:09

GoogleCodeExporter commented 8 years ago
Yes, it seems to work then.

Original comment by balazs.endresz on 26 Mar 2010 at 6:29

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
This has been fixed.  Please let us know if you have any further problems.

Original comment by adam.fel...@gtempaccount.com on 8 Nov 2010 at 9:23