1 decade ago by quidmonkey
I'm testing out leaderboard functionality using Playtomic. I created a test app, and doing the following in main.js:
I'm getting this error:
I checked my index.html and verified I'm including the Playtomic API properly:
Any ideas?
init: function() { Playtomic.Log.View( 427816, 'ef4a86485e514e6d', '5809802bd65d4d50b351970affe11e', document.location ); Playtomic.Log.Play(); for( var i = 0; i < 20; i++ ){ var score = { Name: 'Player #' + i, Points: ( Math.random() * 1000 ).round() }; Playtomic.Leaderboards.Save( score, 'highscores', this.submitComplete ); } Playtomic.Leaderboards.List( 'highscores', this.getLeaderboard, { perpage: 20 } ); }, submitComplete: function( response ){ if( response.Success ){ ig.log( 'Successfully Logged!' ); ig.log( response ); } else{ ig.log( 'Unable to Save High Score!' ); } }, getLeaderboard: function( scores, numscores, response ){ if( response.Success ){ for( var i = 0; i < scores.length; i++ ){ this.scores.push( scores[i] ); } ig.log( 'Leaderboard Retrieved!' ); ig.log( this.scores ); } else{ ig.log( 'Unable to Retrieve Leaderboard' ); } },
I'm getting this error:
Resource interpreted as Script but transferred with MIME type text/html
I checked my index.html and verified I'm including the Playtomic API properly:
<script type="text/javascript" src="http://api.playtomic.com/js/playtomic.v2.0.min.js"></script>
Any ideas?