-2
我正在開發移動購物車,我正在學習本教程,http://go.developer.ebay.com/devzone/articles/building-html5-powered-shopping-cart-ios-part-1
設計Html5 Powered購物車?
在本教程中,Iam將產品作爲Json獲取到Html中。對於使用下面的代碼,把產品爲JSON(IAM),
<?php
// simulates result of db query for categories
$categories = array();
$categories[] = array(id => 1, parent_id => 0, name => 'root');
$categories[] = array(id => 2, parent_id => 1, name => 'Compact Discs');
$categories[] = array(id => 3, parent_id => 1, name => 'Concert Souvenirs');
// simulates result of db query for products
$products = array();
$products[] = array(id => 1, category_id => 2, sku => 'CD001', price=>15.00, name => 'CD: Greatest Hits');
$products[] = array(id => 2, category_id => 2, sku => 'CD002', price=>15.00, name => 'CD: Unplugged');
$products[] = array(id => 3, category_id => 2, sku => 'CD003', price=>15.00, name => 'CD: World Tour');
$products[] = array(id => 4, category_id => 3, sku => 'PD001', price=>10.00, name => 'Souvenir Pin');
$products[] = array(id => 5, category_id => 3, sku => 'PD002', price=>10.00, name => 'Mug');
$products[] = array(id => 6, category_id => 3, sku => 'PD003', price=>20.00, name => 'Hat');
$products[] = array(id => 7, category_id => 3, sku => 'PD004', price=>12.00, name => 'Summer Tour Poster');
$products[] = array(id => 8, category_id => 3, sku => 'PD005', price=>5.00, name => 'Concert Program');
?>
如果我跑catalog.php,我得到JSON輸出但有錯誤,像所有的行未定義的常量。根據上述教程的指導,我創建了任何表格。但是當我訪問索引文件時,我只是空白屏幕。
請幫助我獲得輸出。
如果您收到實際的錯誤消息,那將會很有幫助。 – andrewsi