SORU
29 HAZİRAN 2010, Salı


Yakalanmamış SyntaxError: Unexpected token :

AJAX bir ara benim MooTools script çalıştırıyorum, bu işleri Firefox iyi ama Uncaught SyntaxError: Unexpected token : bir hata alıyorum Krom, neden tespit edemem. Kod kötü kod verir hiçbir şey yerini belirlemek için dışarı yorum, JSON iade edilmesi ile ilgili bir sorun olabilir düşünüyorum. Bu JSON iade görüyorum konsol kontrol ediyor bu

{"votes":47,"totalvotes":90}

Ben herhangi bir sorun göremiyorum, neden bu hata oluşur mu?

vote.each(function(e){
  e.set('send', {
    onRequest : function(){
      spinner.show();
    },
    onComplete : function(){
      spinner.hide();
    },
    onSuccess : function(resp){
      var j = JSON.decode(resp);
      if (!j) return false;
      var restaurant = e.getParent('.restaurant');
      restaurant.getElements('.votes')[0].set('html', j.votes   " vote(s)");
      $$('#restaurants .restaurant').pop().set('html', "Total Votes: "   j.totalvotes);
      buildRestaurantGraphs();
    }
  });

  e.addEvent('submit', function(e){
    e.stop();
    this.send();
  });
});

CEVAP
28 AĞUSTOS 2010, CUMARTESİ


Aynı sorunu olan insanlar için sadece bir BİLGİNİZE, ben sadece benim sunucu uygulaması olarak JSON geri göndermek için/json vardı ve varsayılan bir WordPress kullanmak işleyicisi iyi çalıştı.

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Jared Busch

    Jared Busch

    25 Mayıs 2011
  • New Challenger - Game Reviews

    New Challeng

    20 Temmuz 2006
  • taliajoy18

    taliajoy18

    12 Temmuz 2011