Jump to content
Search Community

Unrecoverable syntax error

Ava test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hi,

 

Does anyone know why I get an unrecoverable syntax error in JSHint?
Below is a script that I have tweaked. The original version was animated.

 

$(document).ready(function(){

$.ajax({
    url: "http://s1.adform.net/Banners/Elements/Templates/14036/8970.xml",
  type: "GET",
    dataType: "xml",
    success: function (xml) {
      
      $(xml).find("Group[name=9]").each(function () {
      var belopp = $(this).find("TextVar[name=summa]").attr("value");
      belopp = belopp.substring(0, belopp.length-3);
      $(".jackpot").html('<h3>Just nu '+belopp+'</h3>');
      });
    }
});
});

 

_________________________________________

 

The original version

 

 $(document).ready(function(){

$.ajax({
    url: "http://s1.adform.net/Banners/Elements/Templates/14036/8970.xml",
  type: "GET",
    dataType: "xml",
    success: function (xml) {
      
      $(xml).find("Group[name=9]").each(function () {
      var belopp = $(this).find("TextVar[name=summa]").attr("value");
      belopp = belopp.substring(0, belopp.length-3);
      $(".jackpot").html('<h3>Drömvinsten är just nu <br /> '+belopp+'</h3>');
        
        var txt = $(".txt");
        var txtIndex = -1;
        var playAnimation = 0;
        
        function playAgain() {
        if (playAnimation <= 4) {
          showNextTxt();
        } else {
          ++txtIndex;
          $(".endframe").show();
          $(".jackpot").hide();
        }
      }
    
      function showNextTxt() {
        ++txtIndex;
        ++playAnimation;
        txt.eq(txtIndex % txt.length).fadeIn(200).delay(3000).fadeOut(300, playAgain);
      }
      
      showNextTxt();
      
      });
    }
});
});
 

 

 

Best,

A

 

Link to comment
Share on other sites

Hello Ava, and Welcome to the GreenSock Forum!

 

This looks like a question for the JSHint devs. ;)

 

In the GSAP forum we have to stay focused on questions only related to the GSAP API.

 

Try posting your question on the JSHInt git Issues page:

 

https://github.com/jshint/jshint/issues

 

They would be more suited to answer your question regarding JS HInt

 

Thanks! :)

  • Like 3
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...