Have your say in Community Polls: What was/is your greatest motivation to start your own business?

Page not loading with Javascript - Dawn 12

Page not loading with Javascript - Dawn 12

blueoval
Visitor
2 0 0

We have a developer attempting to add a configuration tool to our site. The tool uses javascript and the developer has created a landing page containing the code, however it will not load if you click "view page" on desktop, it does load on mobile. 

 

here is a link to the page

https://blueovalindustries.com/pages/lloyd-mats-velourtex

 

This is all I see on the backend

 

Loading Circle.jpg

 

any help is appreciated!

Reply 1 (1)

blueoval
Visitor
2 0 0

Here is the code:

<script src="//ctiapi.com/js/angular-app/widget/cti-widget.js"></script> <script type="text/javascript">
  // <![CDATA[
  (function() {
    var options = {
      apiKey:"lxY48CZyDQ5DstudOAhfOH7Xl3NGc0lk",
      brandCode:"CLRB",
      productLineCode:"VT",
      container:"appContainer", 
      postBackUrl:"/cart/add",
    };
    Configurator.init(options);
  })();
  // ]]>
</script>
<div id="appContainer">
<div align="center" id="showLoader" class="clearfix mar-t20 text-center"><img alt="Loading..." src="//ctiapi.com/images/ajax-loader.gif"></div>
</div>
<script type="text/javascript">
  // <![CDATA[
  var items = [];
  var addItem = function(item,callback) {
    var params = {
      type: 'POST',
      url: '/cart/add.js',
      data: jQuery.param(item),
      dataType: 'json',
      success: function() {
        if ((typeof callback) === 'function') {
          callback();
        }
      },
      error: function(XMLHttpRequest, textStatus) {
        Shopify.onError(XMLHttpRequest, textStatus);
      }
    };
    jQuery.ajax(params);
  };
  var processQ = function() {
    if (items.length) {
      var request = items.shift();
      addItem(request,processQ);
    } else {
      document.location.href = '/cart';
    }
  };
  var myContainer = document.getElementById("appContainer");
  myContainer.addEventListener('addToCartCompleted',
    function (event) {
      var form = jQuery("#postBackForm");
      jQuery("#postBackForm input[name^='id']").each(function(i) {
        items[i] = {id:jQuery(this).val(),quantity:1,properties:{}};
      });
      jQuery("#postBackForm input[name^='Desc']").each(function(i) {
        items[i]['properties']['Description'] = jQuery(this).val();
      });
      jQuery("#postBackForm input[name^='Lloyd']").each(function(i) {
        items[i]['properties']['Lloyd_Code'] = jQuery(this).val();
      });
      processQ();
    }, false
  );
  // ]]>
</script>