Forum Stats

  • 3,757,881 Users
  • 2,251,286 Discussions
  • 7,869,962 Comments

Discussions

How to use Eloqua strict-mode with cookie notification?

Fr3d83
Fr3d83 Member Posts: 1
edited May 31, 2018 5:24AM in JavaScript - Nashorn

Hi,

I´m kind of new to this Eloqua thing.^^

I´ve got this optin / optout banner code from the help center:

<script type="text/javascript">function elqCreateOptInBanner() {if (navigator.appVersion.indexOf('MSIE') != -1) {var css = '.elqOptInBanner {position: absolute; top: 0px;left: 0px; width: 100%; border:solid 1px #c0c0c0; background-color:#e1e1e1;font-size:11px; font-family:verdana; color:#000; padding:5px;} .elqOptInBannerText{float: left; text-align:left; width:96%;} .elqButton {font-size:11px; color:#000;padding:3px;} .elqClose {float:right; font-size:14px; font-weight:bold;cursor:pointer; padding-right:15px;} ';}else {var css = '.elqOptInBanner {position: fixed; top: 0px;left: 0px; width: 100%; border:solid 1px #c0c0c0; background-color:#e1e1e1;font-size:11px; font-family:verdana; color:#000; padding:5px;} .elqOptInBannerText{float: left; text-align:left; width:96%;} .elqButton {font-size:11px; color:#000;padding:3px;} .elqClose {float:right; font-size:14px; font-weight:bold; cursor:pointer;padding-right:15px;} ';}var style = document.createElement('STYLE');style.type = 'text/css';if (style.styleSheet) {style.styleSheet.cssText = css;} else {style.appendChild(document.createTextNode(css));}var head = document.getElementsByTagName('head')[0];head.appendChild(style);var div = document.createElement('div');div.setAttribute('id', 'elqOptInBannerDiv');div.className = 'elqOptInBanner';div.innerHTML = '<div class="elqOptInBannerText" >This website would like to use cookies to store information on your computer which willhelp to customize your interactions with us and provide you with a better browsing experience.You may delete and block cookies from this site, but parts of the site may not function as aresult. More information about cookies and your choices can be found in our Privacy Policy.To accept cookies from this site, please click the \'I Accept\' button below.   <input type="button" id="elqOptInButton" value="I Accept" onClick="elqVisitorTrackingOptIn();document.getElementById(\'elqOptInBannerDiv\').style.display = \'none\';" class="elqButton" />  <input type="button" id="elqOptOutButton" value="I Decline"onClick="elqVisitorTrackingOptOut();document.getElementById(\'elqOptInBannerDiv\').style.display= \'none\';" class="elqButton" /></div><div class="elqClose" onclick="document.getElementById(\'elqOptInBannerDiv\').style.display = \'none\';">x</div>';document.body.appendChild(div);}</script>

But I always get the error Uncaught SyntaxError: Invalid or unexpected token.

And no message, how can I solve this problem?

Thanks