How to send values from form.php to view.js?
Permalink
I have very simple script for mansory grid gallery. I want to control the number of cols from the form. "The problem" i dont know how to set the values dynamic like this.
Install like this:
If i install the script inside view.php it wont work. Get error:
"1087 Uncaught ReferenceError: Macy is not defined(…)"
Install like this:
<script type="text/javascript"> Macy.init({ container: '#macy-container', margin: 12, columns: 3, } }); </script>
If i install the script inside view.php it wont work. Get error:
"1087 Uncaught ReferenceError: Macy is not defined(…)"
Attach them to a dom element as data attribute data-whatever="value", either individually or as a json string. Then in your js, look for the attribute and get the values from it.