I have a php page which contains a PHPlot image and I want to add a button that will print the data values to a new window (or the alert screen, tho not desirable due to array size (> 10k values)) but I am not quite sure how that would work.
- I have considered window.open but that requires a URL so I don't see how that would work
- I also thought about using either $.each to loop over the array and print the values but that doesn't put it on in the new window.
I have the following script chunk so far:
$('.XY').click(function() {
var mz_array = <?php echo json_encode($mz_array) ?>;
var int_array = <?php echo json_encode($int_array) ?>;
for (var i = 0; i < mz_array.length; i++) {
// This is obviously not what I want, it is just here to demonstrate the alert idea
//alert(mz_array[i] - TAB - int_array[i]);
// The below idea has my preference
//window.open( /* printf(mz_array[i] + "\t" + int_array[i] + "\n" */ );
}
});
I would love any suggestion on a smart way how to do this.
PS: The statements under 1 and 2 are based on my limited knowledge, I could very well be wrong.
" for new line, but i am sure you know that already. – Bojan Kovacevic Feb 18 '13 at 14:50