I have written a PHP script to generate an XML document for a chart on one of my genie screens. When the chart loads, I get a popup box with the message 0 -
It happens every time the page loads. I know the URL is valid because I can copy it into a browser window and it returns my xml document. If I paste the XML into the dynamic chart property, the chart renders exactly as I would expect. What could be the issue with the URL?
Strange popup when using URL for fusion charts
-
- New User
- Posts: 13
- Joined: Mon Aug 15, 2016 6:24 pm
- First Name: Dustin
- Last Name: Miles
- Company Name: Unipres USA
- Contact:
-
- Experienced User
- Posts: 2711
- Joined: Wed Aug 01, 2012 8:58 am
- First Name: Scott
- Last Name: Klement
- Company Name: Profound Logic
- City: Milwaukee
- State / Province: Wisconsin
Re: Strange popup when using URL for fusion charts
Dustin,
Its hard to say what may be wrong from this symptom. I would suggest the following:
1) Look in data in the "Network" tab of your browser's developer tools and make sure your PHP is being called and is returning the data in the way you expect.
2) Look for errors in the browsers "Console"
3) Look for errors in the IBM i HTTP server error log
Does any of that provide any useful clues?
Its hard to say what may be wrong from this symptom. I would suggest the following:
1) Look in data in the "Network" tab of your browser's developer tools and make sure your PHP is being called and is returning the data in the way you expect.
2) Look for errors in the browsers "Console"
3) Look for errors in the IBM i HTTP server error log
Does any of that provide any useful clues?
-
- New User
- Posts: 13
- Joined: Mon Aug 15, 2016 6:24 pm
- First Name: Dustin
- Last Name: Miles
- Company Name: Unipres USA
- Contact:
Re: Strange popup when using URL for fusion charts
Yes, good suggestions. The console does give the error message
XMLHttpRequest cannot load [my xml url]. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '[my genie origin]' is therefore not allowed access.
It is adding an auth token to my url. Is this a server config on the chart http server?
XMLHttpRequest cannot load [my xml url]. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '[my genie origin]' is therefore not allowed access.
It is adding an auth token to my url. Is this a server config on the chart http server?
-
- New User
- Posts: 13
- Joined: Mon Aug 15, 2016 6:24 pm
- First Name: Dustin
- Last Name: Miles
- Company Name: Unipres USA
- Contact:
Re: Strange popup when using URL for fusion charts
I was able to solve it by adding header('Access-Control-Allow-Origin: *'); to my php script.
Thank you for the suggestions - once I could see the actual error message it was easy to find the right solution. I don't know why I didn't think to look there, thank you for the nudge in the right direction.
Thank you for the suggestions - once I could see the actual error message it was easy to find the right solution. I don't know why I didn't think to look there, thank you for the nudge in the right direction.
Who is online
Users browsing this forum: No registered users and 2 guests