Announcement

Collapse
No announcement yet.

HTTPS Javascript on HTTP page error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    HTTPS Javascript on HTTP page error

    Afternoon all,

    I've search the form for an answer for this, but can't specifically find out.

    I've got a piece of sakes tracking script, that we need to put on every page of our web-site. As it's a snippet of Javascript code, we need to ensure the script src is https:// on a secure page.

    Similarly, on a non secure page we need it to be http:// as otherwise it causes javascript errors. Therefore, i was wondering, I could surely just used a block if statement within Actinic.

    There are so many SSL Variables - which is the one I need? I will just put both scripts on each page of the site, and then have a block if, which would then (hopefully) show the appropriate one, depending on the type of page the user is on.
    Sam Davis
    Bright Light Media Ltd

    #2
    Try using just src="//www.site.com/file.js" As this doesn't specify a protocol to use, the browser should use the one in force at the time.

    A block if may not be helpful here as it's used when the pages are built, not when they're viewed. You'd have to be sure that you always know the protocol being used for every page before using that.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Hello,

      I tried this, however it still came up with the same problem - strangely on the home page it still utilised https rather than http!

      However I found that I could actually include an https script on an http page by taking the
      Code:
      type="text"
      part out of the Javascript. This results in no errors, so I can now use the same script across the board with no errors.
      Sam Davis
      Bright Light Media Ltd

      Comment

      Working...
      X