My question is, is it possible to do access the variables in Shopify Liquid using Javascript?
{% assign my_array= "apples, oranges, peaches, tomatoes" | split: ", " %}
function my_function(number){
return "{{my_array[number]}}";
}
$('#click_me').click(function(){
alert(my_function(0));
});
I know this is possible with AJAX and PHP, but is there a similar way I can implement using Shopify Liquid and JQuery alone?