Scenario: A client is on a page with a search bar, they enter a query. This query is passed along to a second page that is generated dynamically with php by the server. Along with the query information given to the php script a variable is passed that allows the php script to determine if flash is available to the client's browser. Now the php script displays a png of a network graph generated by cytoscape web if flash is unavailable and a swf of the graph if flash is available.
Problem/Question: 1.) Cytoscape web is a javascript library for displaying graphs. It has an export function(http://cytoscapeweb.cytoscape.org/documentation#section/exportNetwork) but that only allows for a browser to download an exported file. I want to be able to export and save this file during the php runtime and then embed it as content in place of a swf if flash is not enabled. How would I go about doing this if the javascript method has to be run in the client's browser?
Resources
Graph export method 1: http://cytoscapeweb.cytoscape.org/documentation#section/png
Graph export method 2: http://cytoscapeweb.cytoscape.org/documentation#section/exportNetwork