нужно в ява скрипт вставить php $pt
Добавлено 19.05.15 в 14:03:06:
<script type="text/javascript">
var plantsInfo = {"TotalFreeCount":
как сюда вставить $pt
,"AvailableCrops":[{"ImageSrc":"/Content/img/Products/kolosok.png","ProductId":1,"ProductName":"Пшеница","AvailableCount":0},{"ImageSrc":"/Content/img/Products/кукуруза.png","ProductId":2,"ProductName":"Кукуруза","AvailableCount":0},{"ImageSrc":"/Content/img/Products/морковь.png","ProductId":3,"ProductName":"Морковь","AvailableCount":33},{"ImageSrc":"/Content/img/Products/соевые-бобы.png","ProductId":4,"ProductName":"Соевые бобы","AvailableCount":47},{"ImageSrc":"/Content/img/Products/сахарный-тростник.png","ProductId":5,"ProductName":"Сахарный тростник","AvailableCount":8},{"ImageSrc":"/Content/img/Products/индиго.png","ProductId":6,"ProductName":"Индиго","AvailableCount":1},{"ImageSrc":"/Content/img/Products/тыква.png","ProductId":7,"ProductName":"Тыква","AvailableCount":6},{"ImageSrc":"/Content/img/Products/перец.png","ProductId":8,"ProductName":"Чили перец","AvailableCount":0},{"ImageSrc":"/Content/img/Products/помидор.png","ProductId":9,"ProductName":"Томат","AvailableCount":2},{"ImageSrc":"/Content/img/Products/klubnika.png","ProductId":10,"ProductName":"Клубника","AvailableCount":4},{"ImageSrc":"/Content/img/Products/картофель.png","ProductId":17,"ProductName":"Картофель","AvailableCount":0},{"ImageSrc":"/Content/img/Products/хлопок_растение.png","ProductId":22,"ProductName":"Хлопок","AvailableCount":57}]};
$(document).ready(function() {
var pageController = new PlantsPageController(plantsInfo);
pageController.init();
});
</script>
</head>
<body>
а этот код ты выводишь просто или через echo ?
я не силен в ява
как заработает так и введу