I got the arrays to pass by using JSON on them in the js function.