Placing Ethnio Javascript - The Details

Follow
Although our Javascript is very easy to just copy and paste, we figured you might appreciate a bit of an explanation as to what exactly each segment of the code is doing, in case you wanted to impress your IT department. The most important detail is to place Ethnio code as close as possible to your closing body tag (see image below). Ethnio might still work if you place our code in a different part of your page, like in a <div> or an <iframe> but we can't support that and it could break content on your page (!). 

 


 Now on to the code itself:
 
<!-- Ethnio Activation Code -->
<script type="text/javascript" language="javascript" src="//ethn.io/xxxxx.js" async="true" charset="utf-8"></script> 
 
  • <!-- Ethnio Activation Code--> - Just a comment explaining that the code below is the Activation Code.  Doesn't actually do anything to your page.

 

  • type="text/javascript" - This tells the server what kind of code this is.  In this case, it is Javascript.

 

  • language="javascript" - Another way of telling the server that this is Javascript, but is recognized by older browsers.  We use them both to make sure that everyone sees the Ethnio code properly.

 

  • src="//ethn.io/xxxxx" - the // allows you to place it on a SSL or regular HTTP page without changing the code. It cleverly assigns HTTPS or HTTP dynamically.

 

  • async="true" - This just tells the browser to load everything else before it loads the Ethnio code. 

 

 
So there you have it - you now understand the Ethnio code.  You can get even more detailed here in the technical details of our javascript
 
 
Have more questions? Submit a request

Comments

Powered by Zendesk