We have a strange production issue with a SharePoint 2013 master page. It has a script tag pointing to an external script:

<script type=”text/javascript” src=”//domain.client.org/global/script.js”></script>

Which is somehow getting changed to:

<script type="text/javascript" src="/global/script.js"></script>

...which is bad. There is nothing in the version history, so it must be getting SystemUpdate'd somehow, and it's happening simultaneously across all site collections, so I assume it is some kind of timer job doing this.

This happens every couple of days or so. We fix and publish the files, and a few days later they revert back again with no record in version history.

We've found another report of this issue (on 2010) which suggests a patch might be responsible. Our farm's version number is 15.0.4649.1000 (September 2014 CU). It was a fresh install, not upgraded from 2010.

EDIT: We have a couple different authentication mechanisms that require referencing the script in the protocol-agnostic manner.

Anyone ever see this before, and know of a fix?

  • I have noticed that behavior before, fix was to add https: prefix. – Aveenav Aug 31 '16 at 13:45
  • The client has a couple of authentication schemes that require the protocol-agnostic approach. – Derek Gusoff Aug 31 '16 at 13:51
  • I'm thinking another workaround would be document.write way of adding the script tag. – Aveenav Aug 31 '16 at 13:58
  • @Aveenav: That's an interesting workaround, and I might try that, but I'd really like to know why this is happening and prevent it from happening. – Derek Gusoff Aug 31 '16 at 14:09
  • Hey @Aveenav, go ahead and add the https suggestion as an answer, and I'll give you an upvote and the check mark. Browsers will not complain about https loaded from http, just the other way around, so this is an acceptable workaround. – Derek Gusoff Sep 1 '16 at 14:50

A workaround is to add https: prefix/protocol. In some browsers, you may see a a warning that you're mixing secured and unsecured resources if the page has http references.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.