I tried everything suggested above, but still had some problems. In the end, I was able to find a solution using the JSON.parse() method. By adding the following line to my jQuery code:
var filterList = JSON.parse('{"filterList":'+$tasklist.attr("filterlist")+'}');
I was able to access the array as filterList.filterList.
I'm not sure where I went wrong, but I suspect somehow I am not using the jinja2 python library correctly. Nonetheless, this solution worked for me.