# Discourse comments in Vuejs

**URL:** <https://meta.discourse.org/t/discourse-comments-in-vuejs/106128>\
**Category:** Development\
**Created:** [January 9, 2019, 11:18pm UTC](https://meta.discourse.org/t/discourse-comments-in-vuejs/106128 "2019-01-09T23:18:17Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![ahab4ik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ahab4ik/32/128649_2.png) [@ahab4ik](https://meta.discourse.org/u/ahab4ik)\
**Post date:** [January 9, 2019, 11:18pm UTC](https://meta.discourse.org/t/discourse-comments-in-vuejs/106128/1 "2019-01-09T23:18:17Z")

</div>

I have a website that uses Vuejs. And a forum in Discourse. I am trying to insert a javascript in the template file that will connect comments from the forum to a specific page on Vuejs site. But I get the error:

```plaintext
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.

```

I was try change `text/javascript` to `application/javascript` , but when i try render it, i receive error:

```plaintext
 - invalid expression: missing ) after argument list in

" \n DiscourseEmbed = { discourseUrl: 'https://forum.epicseven.ru/',\n                     
discourseEmbedUrl: '"+_s(url absolute="true")+"' };\n\n (function() {\n    
var d = document.createElement('script'); d.type = 
'application/javascript'; d.async = true;\n d.src = 
DiscourseEmbed.discourseUrl + 'javascripts/embed.js';\n    
(document.getElementsByTagName('head')[0] || 
document.getElementsByTagName('body')[0]).appendChild(d);\n })();\n"

  Raw expression: DiscourseEmbed = { discourseUrl: 
'https://forum.epicseven.ru/',
                 discourseEmbedUrl: '{{url absolute="true"}}' };

  (function() {
    var d = document.createElement('script'); d.type = 
'application/javascript'; d.async = true;
    d.src = DiscourseEmbed.discourseUrl + 'javascripts/embed.js';
    (document.getElementsByTagName('head')[0] || 
document.getElementsByTagName('body')[0]).appendChild(d);
  })();

```

As I understand it, the use of js files in Vuejs is allowed only from the domain from which the call originates. And my forum is set to subdomainю

How i can fix this error? Maybe try to use different part of code?

---

_[View the full topic](https://meta.discourse.org/t/discourse-comments-in-vuejs/106128)._
