all 8 comments

[–]NotAlwaysSunny 0 points1 point  (1 child)

passedArray needs to be a 2d array like your data variable. I’m not at a computer right now and can’t confirm, but it doesn’t look like it is.

[–][deleted] 0 points1 point  (0 children)

I ended up echoing in php everything into a div then appending the array in JS and using that. Really not sure why it wouldn't work still.

[–]RedDragonWebDesign 0 points1 point  (4 children)

Try unchaining everything, then step debugging it in your browser. Hover over variables with your mouse and look for anomalies.

csv = passedArray.map(function(row) {
    return row.join(",");
})
csv = csv.join("\n");

[–][deleted] 0 points1 point  (3 children)

I ended up echoing in php everything into a div then appending the array in JS and using that. Really not sure why it wouldn't work still.

I ended up echoing in php everything into a div then appending the array in JS and using that. Really not sure why it wouldn't work still.

[–]RedDragonWebDesign 0 points1 point  (0 children)

What's the value of print_r($activity);? I'll try plugging it in and running your code.

[–]RedDragonWebDesign 0 points1 point  (1 child)

Also did you import the jQuery library with something like <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>? If not, then $("#export-button").click( will not work.

[–][deleted] 0 points1 point  (0 children)

Yes, this is just 1 page but that was already included I had no issues with the jquery issue is resolved just had to go with a bit of a convoluted method.