# Email Builder Showing Javascript Code

**URL:** https://forum.mautic.org/t/email-builder-showing-javascript-code/6222
**Category:** Product Support
**Created:** [October 14, 2016, 2:23am UTC](https://forum.mautic.org/t/email-builder-showing-javascript-code/6222 "2016-10-14T02:23:08Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![trops](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/trops/32/3998_2.png) [@trops](https://forum.mautic.org/u/trops)
#### Post date: [October 14, 2016, 2:23am UTC](https://forum.mautic.org/t/email-builder-showing-javascript-code/6222/1 "2016-10-14T02:23:08Z")

</div>

Hi Guys,  
  
  
  
I made a custom template and when I open the builder all is fantastic. When I make changes to the email and then close builder, I view the content and it shows a huge chunk of javascript at the top of the email.  
  
  
  
Is there something I have done wrong in the template? This is NOT my js code, in fact I have no javascript on the page.  
  
  
  
This only appears when I click “Content” to view the email after using the builder.

Code:

// (function(){var g=this,h=function(b,d){var a=b.split("."),c=g;a[0]in c||!c.execScript||c.execScript("var "+a[0]);for(var e;a.length&&(e=a.shift());)a.length||void 0===d?c[e]?c=c[e]:c=c[e]={}:c[e]=d};var l=function(b){var d=b.length;if(0=d.offsetHeight)a=!1;else{c=d.getBoundingClientRect();var f=document.body;a=c.top+("pageYOffset"in window?window.pageYOffset:(document.documentElement||f.parentNode||f).scrollTop);c=c.left+("pageXOffset"in window?window.pageXOffset:(document.documentElement||f.parentNode||f).scrollLeft);f=a.toString()+","+c;b.b.hasOwnProperty(f)?a=!1:(b.b[f]=!0,a=a=b.e.height&&c=b.e.width)}a&&(b.a.push(e),b.d[e]=!0)};p.prototype.checkImageForCriticality=function(b){b.getBoundingClientRect&&q(this,b)};h("pagespeed.CriticalImages.checkImageForCriticality",function(b){n.checkImageForCriticality(b)});h("pagespeed.CriticalImages.checkCriticalImages",function(){r(n)});var r=function(b){b.b={};for(var d=["IMG","INUT"],a=[],c=0;c

---

<div class="post-metadata">

### Author: ![trops](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/trops/32/3998_2.png) [@trops](https://forum.mautic.org/u/trops)
#### Post date: [October 14, 2016, 2:23am UTC](https://forum.mautic.org/t/email-builder-showing-javascript-code/6222/2 "2016-10-14T02:23:08Z")

</div>

Hi Guys,

I made a custom template and when I open the builder all is fantastic. When I make changes to the email and then close builder, I view the content and it shows a huge chunk of javascript at the top of the email.

Is there something I have done wrong in the template? This is NOT my js code, in fact I have no javascript on the page.

This only appears when I click “Content” to view the email after using the builder.

```auto
// (function(){var g=this,h=function(b,d){var a=b.split("."),c=g;a[0]in c||!c.execScript||c.execScript("var "+a[0]);for(var e;a.length&&(e=a.shift());)a.length||void 0===d?c[e]?c=c[e]:c=c[e]={}:c[e]=d};var l=function(b){var d=b.length;if(0=d.offsetHeight)a=!1;else{c=d.getBoundingClientRect();var f=document.body;a=c.top+("pageYOffset"in window?window.pageYOffset:(document.documentElement||f.parentNode||f).scrollTop);c=c.left+("pageXOffset"in window?window.pageXOffset:(document.documentElement||f.parentNode||f).scrollLeft);f=a.toString()+","+c;b.b.hasOwnProperty(f)?a=!1:(b.b[f]=!0,a=a=b.e.height&&c=b.e.width)}a&&(b.a.push(e),b.d[e]=!0)};p.prototype.checkImageForCriticality=function(b){b.getBoundingClientRect&&q(this,b)};h("pagespeed.CriticalImages.checkImageForCriticality",function(b){n.checkImageForCriticality(b)});h("pagespeed.CriticalImages.checkCriticalImages",function(){r(n)});var r=function(b){b.b={};for(var d=["IMG","INUT"],a=[],c=0;c
```

---

<div class="post-metadata">

### Author: ![trops](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/trops/32/3998_2.png) [@trops](https://forum.mautic.org/u/trops)
#### Post date: [October 14, 2016, 2:31am UTC](https://forum.mautic.org/t/email-builder-showing-javascript-code/6222/3 "2016-10-14T02:31:14Z")

</div>

Ok to recreate the issue.

1. Choose “New Segment Email”
2. Choose a Template
3. Enter a name for the email
4. Choose a segment for the email
5. Click “Apply”

Javascript shows up where I have an image in my template.

If no one responds Ill create an issue for this.

---

<div class="post-metadata">

### Author: ![trops](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/trops/32/3998_2.png) [@trops](https://forum.mautic.org/u/trops)
#### Post date: [October 14, 2016, 2:36am UTC](https://forum.mautic.org/t/email-builder-showing-javascript-code/6222/4 "2016-10-14T02:36:45Z")

</div>

Created new issue:

[Issue 2751](https://github.com/mautic/mautic/issues/2751)

There was definitely an error in the logs…
