jay-jay69 | Hello,
J'utilise dans le cadre de mon site le module open flash chart, pour faire des graphes en flash. Il existe un module qui permet de faire des sauvegardes en PNG directement sur le serveur... J'ai utilisé les exemples de cette page : http://teethgrinder.co.uk/open-fla [...] -image.php pour construire ma page...
Code :
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <meta name="Description" content="XX, XX, XX" />
- <meta name="Keywords" content="XX, XX" />
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <meta name="Distribution" content="Global" />
- <meta name="Author" content="XX" />
- <meta name="Robots" content="index,follow" />
- <script type="text/javascript" src="js/swfobject.js"></script>
- <script type="text/javascript">
- swfobject.embedSWF(
- "open-flash-chart.swf", "my_chart",
- "550", "250", "9.0.0", "expressInstall.swf",
- {"data-file":"data_irma3.php", "id":"eden"} );
- </script>
- <script type="text/javascript">
- // The chart object
- function chart(name) {
- this.name = name;
- this.image_saved = function(id) {
- alert('saved:'+this.name+', id:'+id );
- };
- }
- // create a new chart object
- var my_chart = new chart('chart 1');
- function done(id)
- {
- alert("Finished upload. Id:"+id);
- }
- function post_image(debug)
- {
- //
- // My computer at home is called 'eden'
- // so I want to POST the image to the
- // ofc_upload_image.php script. I am also
- // passing the name of the image file in
- // as a GET variable.
- //
- url = "php-ofc-library/ofc_upload_image.php?name=tmp.png";
- //
- // call the save function in the flash chart,
- // ofc == open flash chart
- //
- var ofc = findSWF("my_chart" );
- // call the done() function when the image has been POSTed
- x = ofc.post_image( url, 'done', debug );
- }
- function post_image_2(debug)
- {
- url = "php-ofc-library/ofc_upload_image.php?name=tmp.png";
- var ofc = findSWF("my_chart" );
- // call our objects image_saved() method when finished
- x = ofc.post_image( url, 'my_chart.image_saved', debug );
- }
- function ofc_ready()
- {
- alert('ofc_ready');
- }
- function findSWF(movieName) {
- if (navigator.appName.indexOf("Microsoft" )!= -1) {
- return window[movieName];
- } else {
- return document[movieName];
- }
- }
- </script>
- </head>
- <body>
- <script language="JavaScript" type="text/JavaScript">
- <!--
- post_image();
- //-->
- </script>
- </body></html>
|
Mais bizarrement absolument rien ne se passe sur ma page... Je ne connais pas grand chose en JS, mais peut-être que vous y voyez qq chose ?
Merci d'avance,
|