google.load("visualization".. problem..

1,246 views
Skip to first unread message

IGonza

unread,
Jun 4, 2010, 11:09:35 AM6/4/10
to Google Visualization API
Hello,

What I'm trying to do is :

Main.html page with code:

<head>
<title></title>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/
libs/jquery/1.3.2/jquery.min.js"></script>
<script>
$(document).ready(function(){
$.ajax({cache:false,timeout:
8000,url:"new_content.html",type:"POST",
error:function(){$("#contentarea").html('<img src="/images/misc/
alert.jpg" alt="system error..."/>');},
success:function(response){$("#viz").html(response);}
});
});
</script>

</head>
<body>
<div id="viz" >
</div>
</body>

As you can see after Main.html loaded javascript sends ajax request
and load response to div.

What I have in new_content.html is :

<script type="text/javascript" src="http://www.google.com/jsapi?
key=..."></script>

<script type="text/javascript">

google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawVisualization);

</script>

The problem is function google.load("visualization", "1", {packages:
["corechart"]}); redirects page to somewhere and nothing is
displayed.
Not sure, but I think it tries to show one of loaded js file from
google server.
I have tested it in Firefox 3.6.3 on MAC.

Example : http://igonza.com/bug/Main.html

Is it a bug?

Thanks,
Igor.

Marcus Schwarz

unread,
Jul 21, 2010, 5:39:26 AM7/21/10
to Google Visualization API
Hi there,

> The problem is function google.load("visualization", "1", {packages:
> ["corechart"]});  redirects page to somewhere and nothing is
> displayed.

did you ever find a solution for that problem? Today I encountered the
same issue, I can't use the visualization API.

Regards,
Marcus

MC Get Vizzy

unread,
Jul 21, 2010, 7:42:33 AM7/21/10
to google-visua...@googlegroups.com
Can you try loading a different package, or a different API, such as the Maps API? Could you send a bigger code sample?

thanks,

MC Get Vizzy


--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.


Marcus Schwarz

unread,
Jul 21, 2010, 8:43:43 AM7/21/10
to Google Visualization API
Hello MC Get Vizzy,

On 21 Jul., 13:42, MC Get Vizzy <getvi...@google.com> wrote:
> Can you try loading a different package, or a different API, such as the
> Maps API? Could you send a bigger code sample?

in the meantime me and my colleague have been able to determine the
problem and fix it. The call for google.load(); must be in the html
head definition. I tried to load it on demand which failed the same
way which IGonza described in the first post. I think thats the
solution for him, too.

Regards,
Marcus

nadun...@gmail.com

unread,
Mar 18, 2013, 5:31:36 AM3/18/13
to google-visua...@googlegroups.com
Hi Marcus Schwarz,

I had same issue.

It was fixed by removing 2 lines 

google.load("visualization", "1", {packages:["corechart"]}); 
google.setOnLoadCallback(drawVisualization); 

I added another code lines at end of the page as 

 $(document).ready(function(){ 
    setTimeout(function(){ 
        google.load("visualization", "1",{'packages':['corechart'],"callback" : drawVisualization );  
  }, 1); 
  }); 

Regards,
Nadun

bruce.c...@enthrive.com

unread,
Sep 12, 2013, 2:42:23 PM9/12/13
to google-visua...@googlegroups.com
Same issue. This fix worked great thanks!
Reply all
Reply to author
Forward
0 new messages