I have following code in HTML part:
<script>
var trainings = {'M':new PlayerTraining(18369,22,355),'D':new PlayerTraining(9412,6,118)};
</script>
This code works well, and 'PlayerTraining' is class defined in one of js-files referenced above.
But when I execute:
<script>
alert(eval("{'M':new PlayerTraining(18369,22,355),'D':new PlayerTraining(9412,6,118)}"));
</script>
I receive the following error:
Uncaught SyntaxError: Unexpected token :
What am I doing wrong? In the end I need to assign that hash (received from WebService) to variable. How to do that?
Please advise.