I took your advice and coded a simple PHP script. It works like a charm with no popups or error messages and I can use HTTP without needing to worry about it. Thanks very much for this tip.
On Aug 28, 1:31 pm, sdeky <[email protected]> wrote: > This may not work for you but one option is that you could write a > class or script that acts as a pass-through to the google chart api. > This is kind of advanced for non-programmers but if you know how to > code, this should be pretty easy. > > The idea is that your image tag in your web page would look something > like this if you were using (sorry, I haven't done this myself so I > don't have functioning code to provide): > <img src="https://example.com/my_goog_chart_redirector.php? > goog_chart_api_params_here" /> > Wherehttps://example.comis your secure website and > my_goog_chart_redirector.php is a script that you write (following the > pseudo code below) and goog_chart_api_params_here are all the normal > parameters that you would send to google. The pseudo code for > my_goog_chart_redirector.php would be something like this: > // Use curl (if you are using php) to make a call > tohttp://chart.apis.google.com/chart?goog_chart_api_params_here > // echo the output to the browser (make sure you send the header > "content-type=image/png" before you echo the output though) > > So the point is that the images on your secure webpage won't ever > point directly to the unsecure google service, but instead, your > images will point to a dynamic script on your secure site that will > itself call google and return the image. Should get rid of those > pesky popup messages. > > I recently used pygooglechart (a python helper for the google chart > api) and it does something similar. Instead of outputing directly to > the browser it saves the image to disk. > def download(self, file_name): > googurl = self.get_url() # googurl is the google chart url > -http://chart.apis.google.com/chart?goog_chart_api_params_here > opener = urllib2.urlopen(googurl) > if opener.headers['content-type'] != 'image/png': > raise BadContentTypeException('Server responded with a > content-type of %s' % opener.headers['content-type']) > open(file_name, 'wb').write(opener.read()) #Saves image to > disk > > Hope that helps. > > On Aug 28, 10:58 am, John <[email protected]> wrote: > > > > > Hi Marcus, > > I did try it. When I use HTTPS, it just shows a placeholder for the > > image with a red X in it. > > When I use HTTP, it gives me the popup warning. > > > On Aug 28, 3:29 am, Marcus Bointon <[email protected]> wrote: > > > > On 28 Aug 2009, at 03:29, John wrote: > > > > > i keep getting the popup that asks if I want to display non-secure > > > > content when I include the > > > > API SRC=http://chart.apis.google.com/chart?inmy<IMG tag. Can I > > > > call the API using HTTPS so that my users won't always see the warning > > > > messages from IE? > > > > I'm guessing you haven't tried it. > > > > Marcus- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Chart API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-chart-api?hl=en -~----------~----~----~----~------~----~------~--~---
