We had a similar issue when trying to build a custom webpart using JS; the code would not execute when Minimal Download Strategy (MDS) was turned on.
As it turns out, SharePoint seems to be smart enough to look for
<script> tags with
So we added a
.html file to SiteAssets, let's say
/sites/mysite/SiteAssets/test.html. And added some content to it:
Then we added a Content Editor Web Part to the page, with a link to the file.
When clicking on "Home," the page is at first loaded with MDS, but then redirects to the actual
.aspx when it discovers the
So, no need to deactivate MDS when specifying