4 Replies Latest reply on Nov 9, 2016 6:17 AM by tc82

    AT.js

    tc82 Level 1

      Hello All,

      we have  requirement where we need to use the st.js form target and show the content on the page.

      As am new to target integration. 

      We did the following steps:

      1. Downloaded the at.js

      2. Created a html file:

      <html>
      <head>
      <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
      <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular-route.js"></script>
      <script src="at.js"></script>
      </head>
      <body >
      Hello

      <div class="Test">
      </div>


      <div class="mboxDefault"></div>


      <script type="text/javascript">

      alert('Hi');

      adobe.target.getOffer({  
        "mbox": "cardinal-global",  
        "success": function(offers) {  
              console.log('offers', offers);
              adobe.target.applyOffer( { "offer": offers } );
        },  
        "error": function(status, error) {          
            if (console && console.log) {
              console.log('Error:status',status);
              console.log('Error',error);
            }
        }
      });

      /*window.addEventListener('load',
          function(e) {
          console.log("GREATTTTT");
              adobe.target.getOffer({
                  "mbox": "NPS_Right1",
                  "params": {
                      "trigger": "customEvent"
                  },
                  "success": function(offer) {
                  console.log("SUCESSS");
                      adobe.target.applyOffer({
                          offer: offer
                      });
                  },
                  "error": function(status, error) { console.log("statusis :", status);console.log("erroris :", error);}
              });
          }
      );*/

      /*NPS_Right1
      adobe.target.applyOffer({  
        
        "selector": ".cssClass #elementId",
        "offer": [{
          "type": "html",
          "content": "<h5>Hello <b>world!!!</b></h5>"
        }]
      });*/

      //var sampleApp = angular.module('sampleApp', ['ngRoute', 'adobe.target.directives']);
      </script>

      <div id="NPS_Right1" data-mboxname="NPS_Right1" mbox class="mboxCreate">
          </div>
      </body>
      </html>

       

       

      am not getting any success back.

      all the time getting the error and the message code is "mbox environment is disabled"

       

      Can anyone please help me on this issues.