Suggestion to change text/javascript to application/javascript
-
Hi,
On our client’s site (btw you cannot see the error as Vue.js only shows them in dev mode) we are using Vue.js for wishlist functionality. This means we render the product list normally and then create an Vue.js instance of it.
However after our partner wanted to add your plugin we get these error from Vue.js:
“Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as <script>, as they will not be parsed.”
So unfortunately Vue.js will strip away the script tag which your plugin adds in setupWooLoopProductData() and setupWooProductData() functions using woocommerce_after_shop_loop_item hook.
However there is a very easy fix for this: to change the text/javascript to application/javascript in setupWooProductData() function in class-events-manager.php in row 403. This way it’s ok to use the script tag in Vue.js templates as well. I know this is an edge case and I’m not the best person to ask favours as we don’t even have a license (yet), but it would be super if you could do this change. I bet this would help others as well.
Thanks in advance.
br,
Turan SadriBTW the contact us form on your website wasn’t working.
The topic ‘Suggestion to change text/javascript to application/javascript’ is closed to new replies.