0

I have a dynamic figure which is generated by jqplot. Now I need to pass this plot to another webpage in the PNG format. My solution is

  1. Convert this jqplot as data url in a variable

    var imgData = $('#chart1').jqplotToImageStr({});
    
  2. Send this variable as part of html form to the next page

    $('<tr style="display:none"><td><input type="hidden" name="extract1"></td></tr>')
        .appendTo('.getpdf')
        .find('input')
        .data(imgData);
    

    I also tried to use .val(imgData), which also failed

  3. Print it and check.

    extract1 = form.getvalue('extract1')

    html = html + """'<'img id="imgChart1" src="%s" />"""%(extract2)

However, on the next page, when I tried to print this variable, I got nothing. It seems like it did escape this variable properly. If I assign extract2 with data-url string, it worked. Could anyone give me some suggestions?

Update:

It seems like the problem existed in the step sending image as data-url to the next page. In the new page, if I supply a verified image data-url, it worked.

4

0 回答 0