locked
Disable Auto change of src="//" RRS feed

  • Question

  • I'm using Microsoft AdCenter and it's converstion tracking.  In my HTML code Microsoft gave me the following code to place on a page which is used to track conversion on our website:

    <script id="mstag_tops" type="text/javascript" src="//flex.atdmt.com/mstag/site/04dd2eda-bbe1-43f4-a9ae-8e8ce0ff810a/mstag.js"></script>

    My problem with Expression is that as soon as I open the file expression changes the above to:

    <script id="mstag_tops" type="text/javascript" src="/../../../../../../flex.atdmt.com/mstag/site/04dd2eda-bbe1-43f4-a9ae-8e8ce0ff810a/mstag.js"></script>

    Anyone know how I can disable this?

    Thanks.

    Tuesday, February 14, 2012 1:00 AM

Answers

  • This is a 'protocol relative link', ie without 'http' or 'https' at the front of it. This is done to avoid the warnings about secure and unsecure content when switching between secure and non-secure pages.

    EW versions prior to V4 SP2 handle this incorrectly and add the additional ../'s you are seeing.

    If you have V4, update it to SP2. If you have any other version the only solution is to edit the file in Notepad each time before you publish, which is messy.


    Ian Haynes

    EW - V4 Add-Ins
    EW - Resources, hints and tips
    EW - Design for the Mobile Web

    Tuesday, February 14, 2012 9:21 AM

All replies

  • It sounds as though you opened the page without first opening the site that contains it. EW has to work within a proscribed website in order to manage links.

    Open the site, then open the page (and make sure that Manage Site with Metadata is turned on).


    Comic Sans walks into a bar. The bartender says, "Get out! We don't serve your type."

    Tuesday, February 14, 2012 1:10 AM
  • That's actually the problem.  The site I'm working on has nothing to do with the <script i'm trying to load there.  The script by it self has //flex. inside it.  It's provided like that from Microsoft AdCenter.  I'm guessing through other JS that they are loading before that they are setting where it should be going as it's not on our server.

    I hope you know what I mean. :)

    Tuesday, February 14, 2012 2:02 AM
  • This is a 'protocol relative link', ie without 'http' or 'https' at the front of it. This is done to avoid the warnings about secure and unsecure content when switching between secure and non-secure pages.

    EW versions prior to V4 SP2 handle this incorrectly and add the additional ../'s you are seeing.

    If you have V4, update it to SP2. If you have any other version the only solution is to edit the file in Notepad each time before you publish, which is messy.


    Ian Haynes

    EW - V4 Add-Ins
    EW - Resources, hints and tips
    EW - Design for the Mobile Web

    Tuesday, February 14, 2012 9:21 AM
  • Ian, you sir have saved me A LOT of time :).  The notepad thing is what I've been doing after the files get pushed out to the server.  I've just updated and it's working like a charm.

    Thank you sir.
    Ado

    Tuesday, February 14, 2012 2:35 PM